diff --git a/support/aphlict/client/src/Aphlict.as b/support/aphlict/client/src/Aphlict.as index 5045a26821..55c48aab13 100644 --- a/support/aphlict/client/src/Aphlict.as +++ b/support/aphlict/client/src/Aphlict.as @@ -34,7 +34,7 @@ package { ExternalInterface.call('JX.Aphlict.didReceiveEvent', type, object); } - final protected function error(error:Error):void { + final protected function error(error:Object):void { this.externalInvoke('error', error.toString()); } diff --git a/support/aphlict/client/src/AphlictClient.as b/support/aphlict/client/src/AphlictClient.as index dbde016a1a..dfbb390231 100644 --- a/support/aphlict/client/src/AphlictClient.as +++ b/support/aphlict/client/src/AphlictClient.as @@ -4,7 +4,7 @@ package { import flash.external.ExternalInterface; import flash.utils.Dictionary; import flash.utils.Timer; - + import flash.events.UncaughtErrorEvent; final public class AphlictClient extends Aphlict { @@ -37,6 +37,10 @@ package { public function AphlictClient() { super(); + loaderInfo.uncaughtErrorEvents.addEventListener( + UncaughtErrorEvent.UNCAUGHT_ERROR, + this.uncaughtErrorHandler); + ExternalInterface.addCallback('connect', this.externalConnect); ExternalInterface.call( 'JX.Stratcom.invoke', @@ -45,6 +49,10 @@ package { {}); } + private function uncaughtErrorHandler(event:UncaughtErrorEvent):void { + this.error(event.error.toString()); + } + public function externalConnect( server:String, port:Number, diff --git a/webroot/rsrc/js/application/aphlict/behavior-aphlict-listen.js b/webroot/rsrc/js/application/aphlict/behavior-aphlict-listen.js index cbb6c6292a..04cd66d378 100644 --- a/webroot/rsrc/js/application/aphlict/behavior-aphlict-listen.js +++ b/webroot/rsrc/js/application/aphlict/behavior-aphlict-listen.js @@ -8,6 +8,7 @@ * javelin-dom * javelin-json * javelin-router + * javelin-util * phabricator-notification */ @@ -54,28 +55,17 @@ JX.behavior('aphlict-listen', function(config) { // a request to Phabricator to get notification details. function onaphlictmessage(type, message) { switch (type) { - case 'error': - new JX.Notification() - .setContent('(Aphlict) ' + message) - .alterClassName('jx-notification-error', true) - .setDuration(0) - .show(); - break; - case 'receive': JX.Stratcom.invoke('aphlict-receive-message', null, message); break; default: - if (__DEV__ && config.debug) { + case 'error': + if (config.debug) { var details = message ? JX.JSON.stringify(message) : ''; - - new JX.Notification() - .setContent('(Aphlict) [' + type + '] ' + details) - .alterClassName('jx-notification-debug', true) - .setDuration(3000) - .show(); + JX.log('(Aphlict) [' + type + '] ' + details); } + break; } } diff --git a/webroot/rsrc/swf/aphlict.swf b/webroot/rsrc/swf/aphlict.swf index 9dc9c59565..b314f019e0 100644 Binary files a/webroot/rsrc/swf/aphlict.swf and b/webroot/rsrc/swf/aphlict.swf differ