diff --git a/lib/tower_sentry/sentry/event.ex b/lib/tower_sentry/sentry/event.ex index 386f40f..5e8e41d 100644 --- a/lib/tower_sentry/sentry/event.ex +++ b/lib/tower_sentry/sentry/event.ex @@ -22,7 +22,7 @@ defmodule TowerSentry.Sentry.Event do def from_tower_event(%Tower.Event{ kind: :throw, - reason: reason, + reason: value, stacktrace: stacktrace, id: id, plug_conn: plug_conn, @@ -31,7 +31,7 @@ defmodule TowerSentry.Sentry.Event do put_environment_name() Sentry.Event.create_event( - message: "(throw) #{reason}", + message: "(throw) #{inspect(value)}", stacktrace: stacktrace, level: :error, request: request_data(plug_conn), diff --git a/test/tower_sentry_test.exs b/test/tower_sentry_test.exs index fb158ac..8f091a1 100644 --- a/test/tower_sentry_test.exs +++ b/test/tower_sentry_test.exs @@ -85,7 +85,7 @@ defmodule TowerSentryTest do "environment" => "test", "exception" => [], "message" => %{ - "formatted" => "(throw) something" + "formatted" => "(throw) \"something\"" }, "threads" => [%{"stacktrace" => %{"frames" => frames}}] } @@ -239,7 +239,7 @@ defmodule TowerSentryTest do "environment" => "test", "exception" => [], "message" => %{ - "formatted" => "(throw) from inside a plug" + "formatted" => "(throw) \"from inside a plug\"" }, "threads" => [%{"stacktrace" => %{"frames" => frames}}], "request" => %{