mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-20 17:37:50 -05:00
Brought up to date with the private repository (feea4c7)
This commit is contained in:
1 parent
1aa738d692
commit
1b1df1ae48
7925 files changed
+2617237
-20
No files matched your search
@@ -0,0 +1,51 @@
|
||||
package
|
||||
{
|
||||
import flash.events.ErrorEvent;
|
||||
import flash.events.UncaughtErrorEvent;
|
||||
import flash.system.Capabilities;
|
||||
|
||||
public class GlobalErrorCatch
|
||||
{
|
||||
|
||||
public function GlobalErrorCatch()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function setupGlobalErrorListener(evt:UncaughtErrorEvent) : String
|
||||
{
|
||||
var message:String = null;
|
||||
var ucEvt:UncaughtErrorEvent = UncaughtErrorEvent(evt);
|
||||
var showErrors:Boolean = gMainFrame.clientInfo.accountType == Utility.INTERNAL;
|
||||
showErrors = true;
|
||||
if(Boolean(ucEvt))
|
||||
{
|
||||
if(!showErrors)
|
||||
{
|
||||
ucEvt.preventDefault();
|
||||
}
|
||||
if(ucEvt.error is Error)
|
||||
{
|
||||
if(Capabilities.isDebugger)
|
||||
{
|
||||
message = Error(ucEvt.error).getStackTrace();
|
||||
}
|
||||
else
|
||||
{
|
||||
message = Error(ucEvt.error).message;
|
||||
}
|
||||
}
|
||||
else if(ucEvt.error is ErrorEvent)
|
||||
{
|
||||
message = ErrorEvent(ucEvt.error).text;
|
||||
}
|
||||
else
|
||||
{
|
||||
message = ucEvt.error.toString();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user