Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors shown as ErlangError instead of the specific error #336

Open
sezaru opened this issue Feb 19, 2021 · 8 comments
Open

Errors shown as ErlangError instead of the specific error #336

sezaru opened this issue Feb 19, 2021 · 8 comments

Comments

@sezaru
Copy link
Contributor

sezaru commented Feb 19, 2021

I don't know if this is expected since it is the first time I used Honeybadger, but most of the errors I'm receiving are encapsulated inside ErlangErrors. For example this one:

image

As you can see, two of the errors are actually Postgrex.Error errors but they are encapsulated inside an ErlangError for some reason. This gives me 2 problems since I lose the nice stack trace view (the whole stack trace is contained inside the message part of the error view page.

And way worse this makes Honeybadger combine errors that don't have anything to do with one another as the same error. You can see this happening in the above image since it combined 2 websocket :close errors with 2 Postgrex errors.

Is there some option to fix this or is this a bug? I'm using the latest version and I also have sasl enabled with the option config :logger, handle_sasl_reports: true.

@joshuap
Copy link
Member

joshuap commented Feb 19, 2021

I'm not sure about this one. @sorentwo @rabidpraxis does this look familiar?

@sorentwo
Copy link
Collaborator

@joshuap This is extremely common. Erlang errors are wrapped by Elixir and will all look like the same error. Some other fingerprinting is necessary to properly differentiate between them.

Having the Postgrex errors wrapped in an ErlangError is strange, though. That may be due to the handle_sasl_reports: true option, as I haven't encountered that particular issue (and dscout has many mis-grouped errors).

@joshuap
Copy link
Member

joshuap commented Feb 24, 2021

This is extremely common. Erlang errors are wrapped by Elixir and will all look like the same error. Some other fingerprinting is necessary to properly differentiate between them.

Makes sense, thanks! Is the fingerprinting something we could think about handling on our end, or is that unique to each user and better handled via config? (Maybe related: #338)

@sorentwo
Copy link
Collaborator

The ErlangError grouping is extremely common and something I'd expect to see handled by the server or library, not something that users should need to do themselves.

@joshuap
Copy link
Member

joshuap commented Feb 24, 2021

Ok, great. I'll keep this open as an enhancement issue... we'll see if we can find someone to work on that at some point.

@sezaru
Copy link
Contributor Author

sezaru commented Feb 24, 2021

I disabled handle_sasl_reports to see if it improve the situation, now I just need to wait for some errors to pop-up and I will update here my findings.

@sezaru
Copy link
Contributor Author

sezaru commented Feb 24, 2021

At first glance it seems to be working fine now with sasl turned off:
image

Now maybe the question is why it encapsulates the error into an ErlangError if sasl is on.

@rktjmp
Copy link
Contributor

rktjmp commented Apr 16, 2021

I am having the same (similar?) error

iex(__@__)4> Honeybadger.notify(%{class: "CustomClass", message: "a matching message"})
:ok

image

Unless I misunderstand the documentation this is the expected result.

The pattern match here:

%{__struct__: exception_mod} = exception

doesn't actually pull out class because the struct is an ErlangError, from Exception.Blame.

It's probably fair to assume no elixir exception will ever match %{class: .., message: ...}, so you could probably match on that.

See #359

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants