[comp.lang.postscript] Writing an Error Handler

pwebb@yoyodyne.ncsa.uiuc.edu (Peter Webb) (05/21/91)

I'm trying to write an error handler, since our printer doesn't do anything
useful (i.e. it just doesn't print the page) when an error occurs.  According
to my interpretation of the red book, page 53-54, there is a special dictionary
called $error that contains information about the most recent error.  But when
I run the file below in xps, I get 'undefined in operator load'.  And it won't
print either.  So I'm wondering how to access this dictionary $error, or
alternatively, how to find the name of the most recent error and the operator
that generated it.  Thanks for any help/advice that you can give.

				Peter Webb (pwebb@ncsa.uiuc.edu).

% Install a useful error handler, one that shows a error message in the 
% center of the page.

/printerrdict 5 dict def

/printerr
{ printerrdict begin
  /str 80 string def
  /err /$error load def

  4.25 inch 6.5 inch translate
  err newerror false put
  -120 20 moveto (Error Name:) show
  -100 0 moveto err /errorname get str cvs show
  -120 -20 moveto (Command Name:) show
  -100 -40 moveto err /command get str cvs show
  stop
  end
} def

errordict /handleerror printerr put

woody@chinacat.unicom.com (Woody Baker @ Eagle Signal) (05/21/91)

>I'm trying to write an error handler, since our printer doesn't do anything
>useful (i.e. it just doesn't print the page) when an error occurs.  According
Adobe has an error handler on the file serverAdobe has an error handler on the file server//
Adobe has an error handler on the file server.  Mail a note to
ps-file-server@adobe.com  with the words  send help

then mail another note to the server for send index.
You will then have the information you need to access the server and
grab the error handler.  A much improved version was posted to the
net some time ago.

Cheers
Woody