Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Sentry
SourceLow level functions to access the Sentry API. You probably want the high level functions in sentry.ml
with_dsn dsn f
overrides the default DSN (from the environment variable SENTRY_DSN
) within the execution of f
with_context f
sets the current thread-local context and runs f
with it.
Like with_new_context
but creates the new context for you as a copy of the current context. ~tags
will be merged into the new context.
Override the environment in the current context
Override the release in the current context
Override the server name in the current context
Merge tags into the current context
Add a breadcrumb to the current context
capture_message ?tags ?dsn message
uploads a message to Sentry using the given dsn
(or looking it up in the environment).
If you pass tags
, it will be as if you called with_tags
before this function.
capture_exception ?dsn ?message e
records the backtrace from e
and an optional message and uploads it to Sentry.
If you pass tags
, it will be as if you called with_tags
before this function.
capture_error ?dsn ?message e
records the backtrace from e
and uploads it to Sentry.
If you pass tags
, it will be as if you called with_tags
before this function.
with_exn_handler ?dsn f
runs f
. If f
throws an exception, it will be uploaded to Sentry and then re-reraised.
with_exn_handler ?dsn f
is like context
except exceptions will not be re-raised. Use this if you're using Sentry in a loop where you want to report on errors and then continue (like in an web server).
val with_error_and_exn_handler :
(unit -> 'a Core_kernel.Or_error.t) ->
'a Core_kernel.Or_error.t
with_error_and_exn_handler ?dsn f
runs f
. If f
throws an exception or error, it will be uploaded to Sentry and then re-raised or returned. Note that Error.t
does not handle backtraces as well as exceptions.
val with_async_exn_handler :
(unit -> 'a Async_kernel.Deferred.t) ->
'a Async_kernel.Deferred.t
with_async_exn_handler f
runs f
. If f
throws one or more exceptions, they will be uploaded to Sentry. The first raised exception willl be re-raised (multiple exceptions could be raised to the Async monitor but only one can be re-raised).
val with_async_exn_handler_ignore :
(unit -> unit Async_kernel.Deferred.t) ->
unit Async_kernel.Deferred.t
See with_exn_handler_ignore
and with_async_exn_handler
val with_async_error_and_exn_handler :
(unit -> 'a Async_kernel.Deferred.Or_error.t) ->
'a Async_kernel.Deferred.Or_error.t
with_async_error_and_exn_handler f
runs f
. If f
throws an exception or returns an error, it will be uploaded to Sentry and then re-raised or returned.