Multiple throw statements and multiple catch statements : Try catch : Statement Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Statement » Try catch »

 

Multiple throw statements and multiple catch statements


 


package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){


        var sUsername:String = "";
        var erToThrow:Error;
        try {
          if(sUsername == "") {
            throw new EmptyStringException();
        
          }
          if(sUsername == undefined) {
            throw new UndefinedException();
          }
        }
        catch (erObject:EmptyStringException) {
              // Code to handle error.
        }
        catch (erObject:UndefinedException) {
          // Code to handle error.
        }
    }
  }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Statement
» Try catch