[ruby-core:119729] [Ruby master Feature#20864] Support `error:` keyword to `Kernel#warn`
From:
"Eregon (Benoit Daloze) via ruby-core" <ruby-core@...>
Date:
2024-11-05 13:47:53 UTC
List:
ruby-core #119729
Issue #20864 has been updated by Eregon (Benoit Daloze). Why not include the error directly in the warning message? It seems that would just work better with the whole `Warning.warn` system and existing handling of warnings. ---------------------------------------- Feature #20864: Support `error:` keyword to `Kernel#warn` https://bugs.ruby-lang.org/issues/20864#change-110396 * Author: ioquatix (Samuel Williams) * Status: Open ---------------------------------------- `Kernel#warn` is extremely useful. It is possible to include some details about the current caller using `uplevel` for the current call stack. But it is not possible to include details about errors. I'd like to propose another extension to log errors. ```ruby begin # some work rescue => error warn "An error occurred!", error: error end ``` Such a feature would allow us to log errors using a standard interface. I don't have an opinion about the implementation, but I wanted to get feedback on the interface. -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/