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.name missing regularly, contained in message #41

Open
thomasbachem opened this issue Jan 9, 2016 · 4 comments
Open

error.name missing regularly, contained in message #41

thomasbachem opened this issue Jan 9, 2016 · 4 comments

Comments

@thomasbachem
Copy link

I observed that while error.name is empty regularly, some browsers prepend it to the message.

E.g. when having

throw new DOMException("INDEX_SIZE_ERR");

Those are the observed values:

Opera 12.12
Name: null
Message: Uncaught exception: Error: DOMException: INDEX_SIZE_ERR

Android Browser 4.2 + 4.4
Name: null
Message: Uncaught DOMException: INDEX_SIZE_ERR

Edge 12 + 13
Name: null
Message: DOMException: INDEX_SIZE_ERR

Or when having this:

throw new Error('Foo')

I saw this in the logs:

Safari 9
Name: null
Message: Error: Foo

I also observed native errors like this:

Safari 9
Name: null
Message: TypeError: foo.bar is not a function

Is there any interest in normalizing this stuff in TraceKit? I think we could parse the names out of the message quite easily using some RegEx magic.

I could implement this if it is something you would include in TraceKit.

@niemyjski
Copy link
Collaborator

My only concern is how do we insure it's always populated correctly. I'd be more than happy to accept this if you have tests for every browser and it works as expected. This would be a very welcoming change.

@niemyjski
Copy link
Collaborator

@thomasbachem would you mind submitting a pull request for this with tests.

@niemyjski
Copy link
Collaborator

@thomasbachem Any chance you can provide a pr for this :).

@thomasbachem
Copy link
Author

Sadly not :/ I'm out of coding for some time and focussing on other stuff.

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

2 participants