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

Add new error.number attribute to error reports #235

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hymerman
Copy link
Contributor

This starts at 1 and increments with each new report sent.

This is incredibly useful for several types of query, but particularly:

  • Filtering to just the first error in each session, since often subsequent errors are knock-ons from the first
  • Sorting errors in a filtered session on the order they happened, which isn't possible when errors happen rapidly enough to get the same timestamps

We have used this change in production on two projects and found it to be very useful.

This starts at 1 and increments with each new report, which allows you to
see which order reports come in, and to filter to just the first error
in each session.
@konraddysput
Copy link
Collaborator

Hey @hymerman - you can use application.session attribute to get all errors generated in one single session and order them by the timestamp (error creation time). Backtrace can do all of this by you. In your case, if you want to have this attribute, wouldn't it be better to use beforeSend method to add it?

@hymerman
Copy link
Contributor Author

Thanks Konrad - so ordering by timestamp within a session is nearly perfect for that use case, but I did find that sometimes, multiple errors would get the timestamp because of how close together they were.

The main benefit from tracking an error order number though, is in being able to filter to the first error in a session. Quite often, one thing will go wrong, which will put the app in a strange state and then cause many further errors, which normally can't ever happen. Fixing the first error fixes all subsequent errors. So it's usually useful, when dealing with a storm of new errors after a release, to focus first on fixing the errors with "error.number == 1" :)

I logged a support request quite a while back to request this (here), but there wasn't any built-in way to do this at the time, which is why I added error.number

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

Successfully merging this pull request may close these issues.

2 participants