You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some OCaml exceptions have special information which we would like to represent in Sentry in ways besides as an sexp string. For example, Async has monitor.Error, which contains a much more useful backtrace in Async code, exceptions thrown by Error.t sometimes also contain backtraces, and other exceptions could probably be parsed into an exception type + title + description instead of merging all of that into a sexp.
An example interface (a not particularly efficient one) is something like:
val register_exn_converter : exn -> Sentry.Exception.t option
let () =
register_exn_converter (function
| My_custom_exception (title, description) -> Some ...
| _ -> None)
Then we could iterate over all of these until we get a Some result, and fall back to sexp version if necessary. We probably also want to expose the default version so implementers can use that, then just override the parts they can do better.
If we do this, we can remove the custom logic for montitor.Error and Error.t and just register converters for them by default.
The text was updated successfully, but these errors were encountered:
Some OCaml exceptions have special information which we would like to represent in Sentry in ways besides as an sexp string. For example, Async has
monitor.Error
, which contains a much more useful backtrace in Async code, exceptions thrown byError.t
sometimes also contain backtraces, and other exceptions could probably be parsed into an exception type + title + description instead of merging all of that into a sexp.An example interface (a not particularly efficient one) is something like:
Then we could iterate over all of these until we get a
Some
result, and fall back to sexp version if necessary. We probably also want to expose the default version so implementers can use that, then just override the parts they can do better.If we do this, we can remove the custom logic for montitor.Error and Error.t and just register converters for them by default.
The text was updated successfully, but these errors were encountered: