lib/bugsnag/rack.rb in bugsnag-5.3.3 vs lib/bugsnag/rack.rb in bugsnag-5.4.0
- old
+ new
@@ -1,7 +1,15 @@
module Bugsnag
class Rack
+
+ SEVERITY_REASON = {
+ :type => Bugsnag::Notification::UNHANDLED_EXCEPTION_MIDDLEWARE,
+ :attributes => {
+ :framework => "Rack"
+ }
+ }
+
def initialize(app)
@app = app
# Configure bugsnag rack defaults
Bugsnag.configure do |config|
@@ -32,18 +40,22 @@
begin
response = @app.call(env)
rescue Exception => raised
# Notify bugsnag of rack exceptions
- Bugsnag.auto_notify(raised)
+ Bugsnag.auto_notify(raised, {
+ :severity_reason => SEVERITY_REASON
+ })
# Re-raise the exception
raise
end
# Notify bugsnag of rack exceptions
if env["rack.exception"]
- Bugsnag.auto_notify(env["rack.exception"])
+ Bugsnag.auto_notify(env["rack.exception"], {
+ :severity_reason => SEVERITY_REASON
+ })
end
response
ensure
# Clear per-request data after processing the each request