
Issue #20864 has been updated by Dan0042 (Daniel DeLorme). I think I agree with the general idea but I'm not sure if the proposal is what I think it is. It's a bit thin about what happens with this "error" keyword exactly. So is the idea that this meta-information would be forwarded to another method to decide what to do with it? Are we talking about extending `Warning.warn` to work like: `warn(*args, **opts)` -> `Warning.warn(formatted_str, **opts)` ---------------------------------------- Feature #20864: Support `error:` keyword to `Kernel#warn` https://bugs.ruby-lang.org/issues/20864#change-110406 * 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/