Just curious: Has anyone successfully created a global error handler that would catch an error from any part of a real application based on Parsley, and on a few other well known frameworks?
Thanks
I have looked into your Catching UncaughtError in Flex Modules.
I dont think my problem relates to modules. Here is what not working for me. We use remoteobjects to comunicate with the server. When we call a service we provide a callback in case of an error. When an error does occur on the server we are getting into this call back function which is a class that is not based on any visual object. I then generate the same test error which is not getting caught.
We are using a single swf file.
What I am saying that if I do this:
| var foo:String = null; | |||
| trace(foo.length); |
in different parts of the apps. this erorr is getting caught. But in the callback function that is called upon a server error I am not seeing this error being caught.
Here is more code:
public function handle(e:RemoteServiceEvent):void
{
var foo:String = null;
trace(foo.length);
}
this error is not getting caught.
Something like this:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at stoneriver.manager.data.persist::baseErrorHandler/handle()[C:\workspa ce\LSCommons\src\stoneriver\manager\data\persist\baseErrorHandler.as:3 1]
at stoneriver.manager.data.persist::LsBaseDataCommand/error()[C:\workspa ce\LSCommons\src\stoneriver\manager\data\persist\LsBaseDataCommand.as: 50]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.rpc::AbstractService/dispatchEvent()[E:\dev\4.5.1\frameworks\proje cts\rpc\src\mx\rpc\AbstractService.as:333]
at uicore.framework.remoting::RemoteObject/__onResult()[C:\workspace\IIP Framework\src\uicore\framework\remoting\RemoteObject.as:124]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.rpc::AbstractService/dispatchEvent()[E:\dev\4.5.1\frameworks\proje cts\rpc\src\mx\rpc\AbstractService.as:333]
at mx.rpc::AbstractOperation/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()[E:\dev\4.5.1\frameworks\projects\rpc\src\mx\rpc\AbstractOperation.a s:254]
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()[E:\dev\4.5.1\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as: 318]
at mx.rpc::Responder/result()[E:\dev\4.5.1\frameworks\projects\rpc\src\m x\rpc\Responder.as:56]
at mx.rpc::AsyncRequest/acknowledge()[E:\dev\4.5.1\frameworks\projects\r pc\src\mx\rpc\AsyncRequest.as:84]
at NetConnectionMessageResponder/resultHandler()[E:\dev\4.5.1\frameworks \projects\rpc\src\mx\messaging\channels\NetConnectionChannel.as:552]
at mx.messaging::MessageResponder/result()[E:\dev\4.5.1\frameworks\proje cts\rpc\src\mx\messaging\MessageResponder.as:235]
This code is not a working example but it does illustrate the problem a bit:
<?xml version="1.0" encoding="utf-8"?>
<applicationArea:ApplicationAreaBase xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:topbar="topbar.*"
xmlns:logging="logging.*"
width="100%"
height="100%"
>
<fx:Declarations>
<logging:GlobalExceptionHandler preventDefault="true" >
<logging:LogHandlerAction/>
<logging:TraceHandlerAction/>
</logging:GlobalExceptionHandler>
</fx:Declarations>
<topbar:TopBar height="59"
width="100%"
id="tb"/>
<s:HGroup width="100%" y="59"
height="100%" gap="0">
<leftMenu:LeftNavigationMenu hideEffect="Fade"
showEffect="Fade"
resizeEffect="Resize"
height="100%"
left="0"
cacheAsBitmap="true"
resize="{rootTabContainer.validateNow()}"
id="lnm"
/>
<rootTab:rootTabContainer id="rootTabContainer"
resizeEffect="Resize"
cacheAsBitmap="true"/>
</s:HGroup>
</applicationArea:ApplicationAreaBase>
Errors generated in TopBar are not getting caught by my error handler.
I am really running out ideas ....
North America
Europe, Middle East and Africa
Asia Pacific