Project: titanium
Issue TIMOB-18103: Generic Error Handling
h1. The Problem When an unhandled error occurs in production (or in builds distributed to testers), the error is either completely lost, or is displayed in a rather unfriendly red dialog. This includes both native and JavaScript errors. h2. Desired Solution Let the developer receive errors in their JavaScript. They can then do whatever they want with the error, such as logging it, or displaying a dialog to the user. These errors should be sent regardless of if the app is running in production or not. h2. Example {code}Ti.App.addEventListener('uncaughtException', function(evt) {	alert({	// Both iOS and Android:	message: evt.message,	line: evt.line,	// iOS Only:	sourceId: evt.sourceId,	type: evt.type,	sourceURL: evt.sourceURL,	backtrace: String(evt.backtrace).substr(0, 100) + '...',	// Android Only:	title: evt.title,	sourceName: evt.sourceName,	lineSource: evt.lineSource,	lineOffset: evt.lineOffset	}); }); throw new Error('Hello, error handler!');{code}
Story points: 8