postscript Error Handling Sequence of events when an error is signaled


Example

The sequence for an error is usually:

  1. error is triggered by looking up the error name in errordict and executing this procedure.
  2. the errordict procedure calls signalerror, passing it the error name.
  3. signalerror takes snapshots of the stacks, saving the snapshots in $error, and then calls stop.
  4. stop pops the exec stack until the nearest enclosing stopped context established by the stopped operator.
  5. if the program has not established its own stopped context to catch the error, it will be caught by an outer-level stopped { errordict /handleerror get exec } if which was called by the startup code to bracket the whole user program.
  6. handleerror uses the information in $error to print an error report.