Home > Running a Script > Handling Errors & Logging > Handling Pause Error

Handling Pause Error

The Pause statement does not generate an error but displays a message box telling that the Pause has failed at line x ; and the script execution ends.

This default behavior is due to the PauseFalse condition generated by Recording mode or Pause Wizards:
  MsgBox("'Wait for' at line " + #ErrorLine$ + " has failed !")

You can replace the lines between PauseFalse and EndPause keywords by your own coding, for example you can display your own message, you can call a Sub, you can assign a variable that you can use later, etc. Just avoid to use a Goto and prefer a call to a Sub for exiting a Pause: Goto in a Pause can create a stack overflow in complex algorithms.

See also

Error Handling Overview
Handling Unexpected Windows
Handling Object not found Error
Handling Page Timeout Error
Handling Inacurrate ClickHTMLElement
Handling Incorrect Typing
Logging Execution