Class: THTP::Server::Instrumentation::Sentry
- Inherits:
-
Object
- Object
- THTP::Server::Instrumentation::Sentry
- Defined in:
- lib/thtp/server/instrumentation.rb
Overview
Captures exceptions to Sentry
Instance Method Summary collapse
-
#initialize(raven) ⇒ Sentry
constructor
A new instance of Sentry.
-
#internal_error(request:, error:, time:) ⇒ Object
An unknown error occurred.
-
#rpc_error(request:, rpc:, args:, error:, time:) ⇒ Object
Handler raised an unexpected error.
Constructor Details
#initialize(raven) ⇒ Sentry
Returns a new instance of Sentry.
196 197 198 |
# File 'lib/thtp/server/instrumentation.rb', line 196 def initialize(raven) @raven = raven end |
Instance Method Details
#internal_error(request:, error:, time:) ⇒ Object
An unknown error occurred
214 215 216 |
# File 'lib/thtp/server/instrumentation.rb', line 214 def internal_error(request:, error:, time:) @raven.capture_exception(error, **http_context(request)) end |
#rpc_error(request:, rpc:, args:, error:, time:) ⇒ Object
Handler raised an unexpected error
206 207 208 |
# File 'lib/thtp/server/instrumentation.rb', line 206 def rpc_error(request:, rpc:, args:, error:, time:) @raven.capture_exception(error, **rpc_context(request, rpc, args)) end |