Skip to content

Commit

Permalink
fix: properly format throw value
Browse files Browse the repository at this point in the history
  • Loading branch information
grzuy committed Nov 19, 2024
1 parent 092d5ff commit 6894969
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/tower_sentry/sentry/event.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions test/tower_sentry_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ defmodule TowerSentryTest do
"environment" => "test",
"exception" => [],
"message" => %{
"formatted" => "(throw) something"
"formatted" => "(throw) \"something\""
},
"threads" => [%{"stacktrace" => %{"frames" => frames}}]
}
Expand Down Expand Up @@ -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" => %{
Expand Down

0 comments on commit 6894969

Please sign in to comment.