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

Error string normalization #25

Open
ubershmekel opened this issue Dec 2, 2017 · 7 comments
Open

Error string normalization #25

ubershmekel opened this issue Dec 2, 2017 · 7 comments

Comments

@ubershmekel
Copy link

ubershmekel commented Dec 2, 2017

I'm not sure if this is within the scope of this project or not. But I did notice that different browsers will have different error strings for the same error. E.g.

ReferenceError: Can't find variable: errorHandler
in
Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_2 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) CriOS/56.0.2924.79 Mobile/14A456 Safari/602.1

vs

ReferenceError: errorHandler is not defined
in
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.70 Safari/537.36

The full stack trace isn't the exact same either, just function names differ I think:

ReferenceError: errorHandler is not defined
at <anonymous> (https://redditp.com/js/script.js:615)
at Object.success (https://redditp.com/js/EmbedIt.js:94)
at i (https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js:2)
at Object.fireWith (https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js:2)
at z (https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js:4)
at HTMLScriptElement.c (https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js:4)
at HTMLScriptElement.dispatch (https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js:3)
at HTMLScriptElement.r.handle (jquery.min.js:3)

vs

ReferenceError: Can't find variable: errorHandler
at <anonymous> (https://redditp.com/js/script.js:615)
at success (https://redditp.com/js/EmbedIt.js:94)
at i (https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js:2)
at fireWith (https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js:2)
at z (https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js:4)
at c (https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js:4)
at dispatch (https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js:3)
at handle (https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js:3)
@steren
Copy link
Collaborator

steren commented Dec 3, 2017

This seems a very relevant suggestion.

I would encourage to build this feature into https://github.com/stacktracejs/stacktrace.js/, which is the library this module uses.

CC @eriwen

@eriwen
Copy link

eriwen commented Dec 4, 2017

Thanks for pinging me @steren. There is an error-stack-normalizer module made to work with stacktrace.js that may at least normalize function names.

Having this built in to stacktrace.js has been requested now a few times now. What would really, really help me out for such a thing is test cases; stack traces across various browsers from a couple projects would be killer. Would one of you folks be willing to provide some?

@eriwen
Copy link

eriwen commented Dec 4, 2017

Thinking about this more: isn't the goal to determine if 2 errors semantically the same? Would it be more useful to have a tool that spit out something like a similarity score instead?

@steren
Copy link
Collaborator

steren commented Dec 4, 2017

The Stackdriver Error Reporting backend groups errors based on complex heuristics, looking at their stacktraces and message.

However, it does not do a good job for browser-based errors, as it does not expect the same code to produce messages that varies.

@Jastrzebowski
Copy link
Contributor

And this can vary even in the same browser, as far as I remember Microsoft one used to throw messages in users language version (this is I18n with capital I ;))

@eriwen
Copy link

eriwen commented Dec 15, 2017

If I read into your comment correctly @steren, normalization only would be most helpful for you.

@steren
Copy link
Collaborator

steren commented Dec 15, 2017

For Stackdriver Error Reporting: yes, the backend already has some grouping function that decides if two errors events are the same error. However, it expects normalized errors the same code error should have the same stack, independently from the browser.

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

No branches or pull requests

4 participants