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

UNTESTED: Include stack trace in [Math Processing Error]->menu->show as error message #1184

Closed
wants to merge 1 commit into from

Conversation

cben
Copy link
Contributor

@cben cben commented May 4, 2015

If I see a [Math Processing Error], its error message is something non-informative like
Error: Cannot read property 'firstChild' of null.
This (or something similar) would help a lot — if not me than you after I file a better bug report :-)
[will file separately for the actual errors that prompted this]

PLEASE TEST.
I only tried this on Chrome and Firefox (Linux) and didn't run any test suite.
The if(err.stack) test sounds safe to me (and https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack claims wide support) but I'm the kind of web dev who breaks stuff in prod and doesn't notice for months...

@dpvc
Copy link
Member

dpvc commented May 4, 2015

In general, people will be using the packed version of MathJax, and so the stack trace will be of very little value (all of MathJax will be on one line, so the line number will be useless, and without that, the message doesn't tell yo very much).

In any case, MathJax stores the error object from the last Math Processing Error in MathJax.Hub.lastError, so you can always get the stack trace from that if you need it. Anyone who is capable of understanding the stack trace should be able to use the browser console to access that variable, and those who aren't really have no need to see it.

So I'm inclined not to make this merge. @pkra, do you have thoughts on this?

@pkra
Copy link
Contributor

pkra commented May 4, 2015

So I'm inclined not to make this merge. @pkra, do you have thoughts on this?

I'm undecided. If more people are interested, it does not seem unfathomable (well, if I ignore the IE10+ part in the browser support). I guess if we switch to uglify we could generate source maps and this becomes more viable in general. But that's a lot of ifs. More something for 3.0 perhaps?

@cben
Copy link
Contributor Author

cben commented May 4, 2015 via email

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.

3 participants