Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/sentry/event.ex
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ defmodule Sentry.Event do
type =
if error_type == :error do
normalized.__struct__
|> to_string()
|> String.trim_leading("Elixir.")
else
error_type
end
Expand Down
2 changes: 1 addition & 1 deletion test/event_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ defmodule Sentry.EventTest do

assert event.exception == [
%{
type: UndefinedFunctionError,
type: "UndefinedFunctionError",
value: "function Sentry.Event.not_a_function/3 is undefined or private",
module: nil
}
Expand Down
4 changes: 2 additions & 2 deletions test/logger_backend_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ defmodule Sentry.LoggerBackendTest do
Bypass.expect(bypass, fn conn ->
{:ok, body, conn} = Plug.Conn.read_body(conn)
json = Jason.decode!(body)
assert List.first(json["exception"])["type"] == "Elixir.ErlangError"
assert List.first(json["exception"])["type"] == "ErlangError"
assert List.first(json["exception"])["value"] == "Erlang error: :bad_exit"
assert conn.request_path == "/api/1/store/"
assert conn.method == "POST"
Expand Down Expand Up @@ -108,7 +108,7 @@ defmodule Sentry.LoggerBackendTest do
"post_context" => []
} = List.last(json["stacktrace"]["frames"])

assert List.first(json["exception"])["type"] == "Elixir.FunctionClauseError"
assert List.first(json["exception"])["type"] == "FunctionClauseError"
assert conn.request_path == "/api/1/store/"
assert conn.method == "POST"
send(self_pid, "API called")
Expand Down