# HG changeset patch # User Matthew Wild # Date 1607552629 0 # Node ID a0d20e3786702d6905e6f8fcb372dee31d847f95 # Parent 2c73544e33eae1f17975824da6b414bf3d3db62e mod_sentry: Pull default message from error text or wrapped error (if string) diff -r 2c73544e33ea -r a0d20e378670 mod_sentry/sentry.lib.lua --- a/mod_sentry/sentry.lib.lua Wed Dec 09 16:30:21 2020 +0000 +++ b/mod_sentry/sentry.lib.lua Wed Dec 09 22:23:49 2020 +0000 @@ -133,6 +133,13 @@ function sentry_event_methods:add_exception(e) if errors.is_err(e) then e = error_to_sentry_exception(e); + if not self.event.message then + if e.text then + self:message(e.text); + elseif type(e.context.wrapped_error) == "string" then + self:message(e.context.wrapped_error); + end + end elseif type(e) ~= "table" or not (e.type and e.value) then e = error_to_sentry_exception(errors.coerce(nil, e)); end