Skip to content

syntax error (aka. simple errors) are not traced #20

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

Closed
msawired opened this issue May 30, 2019 · 1 comment
Closed

syntax error (aka. simple errors) are not traced #20

msawired opened this issue May 30, 2019 · 1 comment

Comments

@msawired
Copy link

Hello!

I started using stacktracejs on OpenProcessing, and realized that in cases where error is a simple error without error.stack (e.g. a syntax error), stacktracejs returns an empty trace array, although the exception itself actually includes the filename, linenumber, charnumber.

window.onerror = function (msg, url, lineNumber, columnNo, error) { //no error.trace, but stacktrace can use msg, url, lineNumber, columnNo to create a single element array. StackTrace.fromError(error) .then(function(stackArray){ //stackArray is empty }) .catch(function (err) { //doesnt come here either }); } }

proposed solution
if error.stack is not accessible, stacktrace can still return a single item array using msg, url, lineNumber, columnNo provided.

What do you think?

@eriwen
Copy link
Member

eriwen commented Jan 5, 2020

It seems like a good idea, but it doesn't belong on this particular project. I've moved this issue to stacktracejs/stacktrace.js#217

@eriwen eriwen closed this as completed Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants