Problem
When running the emulator, if errors are encountered, they should show the standard red screen of death to the user. Even if the underlying build type is
release
, we need to find a way to surface these errors to the developer in the traditional Titanium way.
Solution
Introduce (or tweak, if it's already there) a deploy type with values such as "development" or "production" like we do for other platforms. Then, use this value to decide whether or not we should show the error dialog, instead of the build type.
Example
var win = Ti.UI.createWindow();
win.add(Ti.UI.createLabel({ text: 'Please Wait...' }));
win.open();
setTimeout(function() {
throw new Error('oh no!');
}, 2000);
ti build -p windows -C 8-1-1 -G 00000000-0000-1000-8000-000000000000
https://github.com/appcelerator/titanium_mobile_windows/pull/294
Verified the fix. Device & emulator both show error dialogs. Closing. Environment: Appc Studio: 4.1.0.201506211738 Ti SDK: 4.1.0.v20150622145911 Ti CLI: 4.0.1 Alloy: 1.6.2 Windows: 8.1 Enterprise 64-bit APPC NPM: 4.1.0-1 APPC CLI: 4.1.0-1 Device: Nokia Lumia 928 - Windows Phone 8.1 Windows phone emulator : 8.1.1