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

Improve argument reporting #123

Open
joshuap opened this issue Dec 13, 2017 · 12 comments
Open

Improve argument reporting #123

joshuap opened this issue Dec 13, 2017 · 12 comments

Comments

@joshuap
Copy link
Member

joshuap commented Dec 13, 2017

Honeybadger now supports sending arguments, however the cases where the arguments are actually available seem limited; see this comment by @sorentwo.

We may be able to provide arguments more often by studying how Elixir/iex display the arguments in printed stack traces.

@TraceyOnim
Copy link
Contributor

TraceyOnim commented Jul 9, 2021

I have found out, arguments are available when a FunctionClauseError is reported. Here is the explanation.

With that, I have also found out that, the stack trace is been parsed at notice.ex line 57. Hence for the limited cases like FunctionClauseError, the arguments are not available for the final output. There is an existing PR for the fix

@joshuap
Copy link
Member Author

joshuap commented Jul 12, 2021

@TraceyOnim nice!

So with #373 merged, what should the documentation say about filter_args? It still only works for FunctionClauseError, right? If that's the case, we should update the README with that information to make it clear how it works. Do you want to work on that?

Also, I added a changelog entry for #373: 44c15cf

@joshuap
Copy link
Member Author

joshuap commented Jul 12, 2021

Another question: do you think it's possible to display args for other types of exceptions with some additional research/work in the future? Or should I close this issue after the documentation is updated?

@TraceyOnim
Copy link
Contributor

@TraceyOnim nice!

So with #373 merged, what should the documentation say about filter_args? It still only works for FunctionClauseError, right? If that's the case, we should update the README with that information to make it clear how it works. Do you want to work on that?

Also, I added a changelog entry for #373: 44c15cf

From the research, I can say filter_args only works with FunctionClauseError.
Yes , I can work on the documentation

I have checked the changelog 44c15cf. Arguments are shown when filter_args is set to false, right? The changelog states true

@joshuap
Copy link
Member Author

joshuap commented Jul 12, 2021

I have checked the changelog 44c15cf. Arguments are shown when filter_args is set to false, right? The changelog states true

Ah yeah, good catch! I'll fix it.

@TraceyOnim
Copy link
Contributor

Another question: do you think it's possible to display args for other types of exceptions with some additional research/work in the future? Or should I close this issue after the documentation is updated?

Lemme do some additional research on this first before closing. Just in case I might miss something

@joshuap
Copy link
Member Author

joshuap commented Jul 12, 2021

@sorentwo I've been thinking, would it make sense to default to filter_args = false in the next major release, so that args are reported w/ FunctionClauseError by default?

@TraceyOnim
Copy link
Contributor

@sorentwo I've been thinking, would it make sense to default to filter_args = false in the next major release, so that args are reported w/ FunctionClauseError by default?

Great idea, I second this

@sorentwo
Copy link
Collaborator

@joshuap That would improve the experience for most people and isn't a breaking change. I'm in favor 👍

@joshuap
Copy link
Member Author

joshuap commented Jul 12, 2021

@sorentwo I've been thinking, would it make sense to default to filter_args = false in the next major release, so that args are reported w/ FunctionClauseError by default?

Great idea, I second this

@TraceyOnim great, want to submit a PR for that? If the two of you are good with a minor release instead of major (since it's not breaking), I'm good with that.

@TraceyOnim
Copy link
Contributor

@sorentwo I've been thinking, would it make sense to default to filter_args = false in the next major release, so that args are reported w/ FunctionClauseError by default?

Great idea, I second this

@TraceyOnim great, want to submit a PR for that? If the two of you are good with a minor release instead of major (since it's not breaking), I'm good with that.

Sure, I can submit the PR

@joshuap
Copy link
Member Author

joshuap commented Jul 13, 2021

Confirmed that args are reported properly for FunctionClauseError in v0.16.4!

image

For future reference, here's a simple way to cause a FunctionClauseError:

Enum.drop([1, 2, 3], 0.0)

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

3 participants