[TIMOB-7165] When an app experiences a JavaScript crash, write a [FATAL] error to the log/console
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Low |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Tooling |
Labels | tbs-1.9.0 |
Reporter | Ingo Muschenetz |
Assignee | Ingo Muschenetz |
Created | 2012-01-12T22:41:50.000+0000 |
Updated | 2015-04-13T20:10:06.000+0000 |
Description
During development, a Titanium mobile application might encounter a fatal error, such as a missing or malformed JavaScript file. Our goal is to alert the user in as informative way as possible where the issue is (and eventually suggest a fix).
As a first step, when an application encounters such an error, we would like the app to write out a console message similar to:
[FATAL] Error Description app://path/to/file.js:85
This would be similar (or identical to) similar messages written during debugging, with an ap-relative path to the file, and a line #.
Once we have this message, we can tune Studio to look for it and act upon it.
Information on which line of code error occurred would be nice to have.
Thank you for reminding me. I had forgotten the line number as part of the message.
For both Android and iOS, this is only going to be available when the JS itself causes an issue, not when there's an internal error due to improper use of classes (we can't track line numbers there, or call back to the system to get the line number).
Will we know at least the file that caused the problem?
We might be able to track that information, but that could be tricky for things like cross-context callbacks on iOS.