5 Replies Latest reply on Jan 18, 2013 2:24 PM by Flex harUI

    Flex bug in global error handling


      My application's global error handler (uncaught error handler) works mostly, but I found a case where it doesn't work, but should.  Before I filed an official bug report I wanted to post the issue here.


      Here is the issue: in a module, ErrorEvents that are not listened for  and are dispatched by a Flex component are never caught in the application's uncaught error handler. 


      I have a sample project that demonstrates this.  Here is the module in my test case:


      <?xml version="1.0" encoding="utf-8"?>

      <s:Module xmlns:fx="http://ns.adobe.com/mxml/2009"





              private function onClickSparkDispatch():void {

                  dispatchEvent( new ErrorEvent( ErrorEvent.ERROR, false, false, "test" ) );   // this isn't caught in the uncaught error handler


              private function onClickNonSparkDispatch():void {

                  var nonSparkDispatcher:EventDispatcher = new EventDispatcher();

                  nonSparkDispatcher.dispatchEvent( new ErrorEvent( ErrorEvent.ERROR, false, false, "test" ) );  // this is caught in the uncaught error handler





              <s:Button label="Module Spark Dispatch (broken)" click="onClickSparkDispatch()" />

              <s:Button label="Module Non-Spark Dispatch" click="onClickNonSparkDispatch()" />




      Using Flex 4.6

      My application statically links in the Flex SDK ("merged into code" in Flash Builder).

      My applications works around these two exsiting bugs:




      Is this a bug?