lib/appsignal/rack/sinatra_instrumentation.rb in appsignal-1.2.1.beta.1 vs lib/appsignal/rack/sinatra_instrumentation.rb in appsignal-1.2.1.beta.2
- old
+ new
@@ -37,10 +37,12 @@
transaction.set_error(error)
raise error
ensure
# If raise_error is off versions of Sinatra don't raise errors, but store
# them in the sinatra.error env var.
- transaction.set_error(env['sinatra.error']) if !@raise_errors_on && env['sinatra.error']
+ if !@raise_errors_on && env['sinatra.error'] && !env['sinatra.skip_appsignal_error']
+ transaction.set_error(env['sinatra.error'])
+ end
transaction.set_action(env['sinatra.route'])
transaction.set_metadata('path', request.path)
transaction.set_metadata('method', request.request_method)
transaction.set_http_or_background_queue_start
Appsignal::Transaction.complete_current!