airbrake: Set metadata to be sent if an exception occurs?
Hi
Is there a way to set metadata context
and params
like in Honeybadger.context
?
That would be very helpful, because usually the place that Airbrake.notify(e)
is a high level class, and sometimes the one that raises an exception is super further down, so it would be super cool being able to:
def execute
call_a_all_the_way_down_to_c
rescue e
Airbrake.notify(e)
end
def c
# something
rescue e
Airbrake.context(user_id: user_id)
end
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 1
- Comments: 17 (14 by maintainers)
Commits related to this issue
- Implement basic API for merging context Fixes #314 (Possible to set context for possible error?) This feature has been request many times already. While Airbrake supports it, it's not obvious for us... — committed to airbrake/airbrake-ruby by kyrylo 6 years ago
- Implement basic API for merging context Fixes #314 (Possible to set context for possible error?) This feature has been request many times already. While Airbrake supports it, it's not obvious for us... — committed to airbrake/airbrake-ruby by kyrylo 6 years ago
- Implement basic API for merging context Fixes #314 (Possible to set context for possible error?) This feature has been request many times already. While Airbrake supports it, it's not obvious for us... — committed to airbrake/airbrake-ruby by kyrylo 6 years ago
- README: fix example Pointed in https://github.com/airbrake/airbrake/issues/696#issuecomment-384778353 — committed to airbrake/airbrake-ruby by kyrylo 6 years ago
Since airbrake-ruby v2.9.0 you can set context with
Airbrake.merge_context
: https://github.com/airbrake/airbrake-ruby#airbrakemerge_contextMy need is for something exactly like
Honeybadger.context
, so I can append useful information to the error in any layer, and in the main executor I onlynotify
, as the main one does not have access to all meaningful information deep down in all other layers.Does that make sense?
Most of the exceptions aren’t my own, for example
Stripe::Error
.@kyrylo it seems the example is missing the param
(veggies)
:Sorry for the delay! I’ve been distracted by other tasks. Given the growing interest in this feature, I plan to work on it next week. I am going to close this issue in favour of https://github.com/airbrake/airbrake-ruby/issues/187 because that repo is the correct place (airbrake-ruby needs to be modified to implement the feature).