Skip to content

Commit 652e1dc

Browse files
authored
Fix log formatting under 1.14 (#851)
This will go away soon once we drop support for <= 1.14 So we're skipping tests for this.
1 parent 1f25a85 commit 652e1dc

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/sentry/logger_handler.ex

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,16 @@ defmodule Sentry.LoggerHandler do
375375
%{format: ~c"Ranch listener ~p" ++ _, args: args} ->
376376
capture_from_ranch_error(args, sentry_opts, config)
377377

378+
# Handles errors which may occur on < 1.15 when there are crashes during
379+
# initialization of some processes.
380+
%{label: {_lib, _reason}, report: report} when is_list(report) ->
381+
error = Enum.find(report, fn {name, _value} -> name == :error_info end)
382+
{_, exception, stacktrace} = error
383+
384+
sentry_opts = Keyword.merge(sentry_opts, stacktrace: stacktrace, handled: false)
385+
386+
capture(:exception, exception, sentry_opts, config)
387+
378388
_ ->
379389
capture(:message, inspect(report), sentry_opts, config)
380390
end

0 commit comments

Comments
 (0)