7 Replies Latest reply on Jul 2, 2007 12:50 PM by Robert Hirst

    Error Window Dismiss All don't understand why?

    levancho Level 3
      I donw understand why player offers option to dismiss exception and continue execution of faulty application, is there a way prevent that?
      for example if I have code
      public function myfunc():Boolean{
      ... some other code ....
      if(UserNotAuthorized){
      throw new MyError("lalala ");
      }
      return true;


      my question is if UserNotAuthorized is true, this method should not return and throw error,
      now user get prompt window and also have option to dismiss all, now what I am interested in is what really happens when user clicks dismiss all? does my method action gets reevaluated and returns ? or its just hangs there?


      }




        • 1. Re: Error Window Dismiss All don't understand why?
          ntsiii Level 3
          I am not certain, having not used "throw", but in my experience, dismiss all typically breaks the current session functionality. On the other hand, "Continue" simply bypasses the current error and the app continues to function.

          Tracy
          • 2. Re: Error Window Dismiss All don't understand why?
            jaswcomp
            I've been scouring the web for information about error handling. My understanding is that if you use throw there must be a try..catch block around the code that uses the function throwing the error. Otherwise it's an "uncaught exception" that gets handled by the Flash player. I haven't been able to find a way to control how the Flash player handles these errors. I can't find a "global" error handler.
            • 3. Re: Error Window Dismiss All don't understand why?
              levancho Level 3
              quote:

              Originally posted by: jaswcomp
              I've been scouring the web for information about error handling. My understanding is that if you use throw there must be a try..catch block around the code that uses the function throwing the error. Otherwise it's an "uncaught exception" that gets handled by the Flash player. I haven't been able to find a way to control how the Flash player handles these errors. I can't find a "global" error handler.

              my goal is actualy oposite of catching error --> throw it to player
              if I catch error that I throw it will not do any good since I don't what to recover from that error.



              so looks like its bad idea to use error handing to try to hult the process of the application, it seems that all errors are recoverable ,
              then what is the best recommendation to achange desired result of just halting the proccess for the application completely with error message.
              currently I have following :

              // checks access level parameter
              if(accessLevel!=SecurityManager.ACCESS_ADMIN &&
              accessLevel!=SecurityManager.ACCESS_BOSS_WITH_CIGAR &&
              accessLevel!=SecurityManager.ACCESS_BOSS_NO_CIGAR){
              throw new MyError(MyErrorMessageCodes.INVALID_PARAMETER,
              "[registerModule(accessLevel:int="+accessLevel+")]");
              }

              • 4. Re: Error Window Dismiss All don't understand why?
                Robert Hirst Level 1
                Doesn't that "Dismiss/Continue" dialog only pop up for the Debug version of the Flash Player? I don't think you can depend on it in normal circumstances.

                Could you have a state which you jump into when an error occurs, which just displays an error and has no means of navigation back to the main app?
                • 5. Re: Error Window Dismiss All don't understand why?
                  gjastrab Level 1
                  Correct, that Continue/Dismiss error is only displayed if the Debugging version of the Flash player is installed.
                  • 6. Re: Error Window Dismiss All don't understand why?
                    jaswcomp Level 1
                    So is it possible to have a global error handler? This has always been a fundamental part of any application that I have built in the past.
                    • 7. Re: Error Window Dismiss All don't understand why?
                      Robert Hirst Level 1
                      As I understand it, that's been the topic of some discussion (try a google on "as3 uncaught exceptions") which hasn't been fully resolved. I understand it would potentially involve some modification to the Flash Player itself.

                      It would be a nice feature to have, and I would also be very interested if anyone does have a working solution for this situation.