PDA

View Full Version : [CLOSED] [4.2.1] Javascript error objects are being replaced by plain exception messages



feiichi
23 Sep 2013, 10:59 PM
Since upgrading from 4.0.1 to 4.2.1 we were getting plain exception messages when encountering an error in a (custom) Ext class with meaningless line and file pointers. For example calling a method on an undefined object resulted in something of little to no help:

In FF:
Error: My.String is undefined in ext-dev.js on 12300

In Chrome:
Error: Cannot call method 'camelize' of undefined in ext-dev.js on 12300

Instead of the usual Uncaught TypeError with the real line number, file name and stack trace.

I tracked this and found the method applyOut (starting on line 24353 in ext-dev.js) that is catching such sorts of exceptions and "throws away" everything besides the exception message. I didn't dig deeper into this - why it's started to work like this in 4.2 and why it's there in the first place.

Update: I looked into it a little bit more and it looks like this happens in renderer functions so it seems to be related to templates. Also see: http://www.sencha.com/forum/showthread.php?259858

Nonetheless I was able to temporarily fix this by re-raising the exception after the line 24369:

throw e;

I believe this is something that should be addressed as it gravely disrupts debugging process especially in large applications.

Gary Schlosberg
25 Sep 2013, 4:02 PM
Thanks for the report! I have opened an Improvement in our bug tracker.