-
Bug
-
Resolution: Fixed
-
Normal
-
9.5.1.2
-
Security Level: Jimmy
-
None
Steps to Reproduce
produce an error during widget initialization (usually happens accidentally)
jserror.Awidget = zk.$extends(zul.wgt.Span, { $define: { prop1: _myFunc = function() { console.log("something"); }, prop2: _myFunc, prop3: myFunc /* forgot '_' */ } }, {});
Current Result
the console error shows a misleading error message, omitting the real cause
Expected Result
also show the root cause why the widget is "Unknown"
especially the line number where the error happens
e.g. log or rethrow the error
catch(error) { console.error(error); } or catch(error) { throw error; }
also consider failing the package load operation by not calling setLoaded and report a meaningful error message instead
e.g.
"failed to load 'mypackage.wpd' check browser console for error details"
Debug Information
as of now there's a try without a catch block swallowing the error
Workaround
enable stop on uncaught exceptions in dev tools (hard to know when the error indicates nothing)