Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!zaphod.mps.ohio-state.edu!caen!news.cs.indiana.edu!ux1.cso.uiuc.edu!yoyodyne!pwebb From: pwebb@yoyodyne.ncsa.uiuc.edu (Peter Webb) Newsgroups: comp.lang.postscript Subject: Writing an Error Handler Message-ID: <1991May20.210035.12141@ux1.cso.uiuc.edu> Date: 20 May 91 21:00:35 GMT Sender: usenet@ux1.cso.uiuc.edu (News) Organization: National Center for Supercomputing Applications at Urbana Illinois Lines: 32 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