2 Replies Latest reply on Dec 15, 2008 5:09 PM by Fred Goldman

    [JS] Error Catching

    Fred Goldman Level 3
      When you use a try/catch statement you can send the error to a variable.
      Then you can set up an alert to tell you the error. For example:

      try{
      code
      code
      code
      }catch (error){
      alert(error)
      exit()
      }

      My question is, is there anyway for the alert to tell me what line the
      error was caused on? In the example I just gave, how would I know which
      of the three lines of code caused the error?