home *** CD-ROM | disk | FTP | other *** search
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %% %%
- %% errodict.ps: define the standard error handlers. %%
- %% %%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %% %%
- %% `Backstop' errors allow you to prevent the default error handler %%
- %% from being over-ridden by downloaded error handlers. This can %%
- %% save film for typesetter output, and can be critically important %%
- %% to avoid deadly embraces if for example you get a VMerror during %%
- %% device setup. The following list is representative. %%
- %% %%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
- errordict begin
-
- /backstoperrors [
- /VMerror /interrupt /timeout /ioerror /configurationerror
- ] def
-
- end
-
-
- systemdict begin
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %% %%
- %% This is the default error action as described in section 3.10 of %%
- %% the Red Book. %%
- %% %%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
- /.error {
- currentglobal 3 1 roll
- false setglobal
- $error exch /errorname exch put
- $error exch /command exch put
- $error /newerror true put
- $error /recordstacks get {
- count array astore
- $error exch /ostack exch put
- $error /dstack countdictstack array dictstack put
- $error /estack countexecstack array execstack dup length 2 sub 0
- exch getinterval put
- $error /ostack get aload pop
- } if
- setglobal
- stop
- } binddef
-
-
- $error /recordstacks true put
- $error /binary false put
- $error /newerror false put
- $error /errorinfo null put
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %% %%
- %% This is needed at the end of unencapsulated jobs that call %%
- %% executive, to remove the last reference to stdin. Because TPro %%
- %% uses a reference counted memory, stdin would not get close %%
- %% otherwise. %%
- %% %%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
- /clearerrorstacks {
- $error /ostack null put
- $error /dstack null put
- $error /estack null put
- $error /newerror false put
- } binddef
-
- end % systemdict
-
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %% %%
- %% And to print the error messages: %%
- %% %%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
- errordict begin
-
- /handleerror {
- $error begin
- newerror {
- binary currentobjectformat 0 ne and {
- /Error errorname /command load
- dup type /filetype eq {pop /--file--} if
- false
- printerrorobject
- } {
- /newerror false def
- (%%[ Error: ) print
- errorname dup type /stringtype ne { 256 string cvs } if print
- (; OffendingCommand: ) print
- errorname /undefined eq /command load
- dup /get eq 1 index /get load eq or
- 1 index /load eq or exch /load load eq or
- and {
- (/) print ostack dup length 2 sub get
- dup type dup /nametype eq {
- pop dup length string cvs
- } {
- /stringtype ne {256 string cvs} if
- } ifelse
- print ( ) print
- } if
- /command load dup type dup /nametype eq {
- pop dup length string cvs
- } {
- /stringtype ne { 256 string cvs } if
- } ifelse
- print
- ( ]%%\n) print
- errorinfo null ne {
- errorname /ioerror eq {
- (%%[ File: )
- } {
- errorname /configurationerror eq {
- (%%[ Request: )
- } {
- (%%[ Key: )
- } ifelse
- } ifelse
- print
- errorinfo 0 get dup type /stringtype ne {256 string cvs} if print
- errorname /ioerror eq {(; Reason: )} {
- errorname /undefinedresource eq {(; Category: )} {(; Value: )} ifelse
- } ifelse
- print
- errorinfo 1 get dup type /stringtype ne {256 string cvs} if print
- /errorinfo null def
- ( ]%%\n) print
- } if
- } ifelse
- flush
- } if
- end
- } binddef
-
- /errorbackstop /handleerror load def
-
- systemdict /handleerror /handleerror load put
-
- /undefined {/undefined .error} def
- /configurationerror {/configurationerror .error} def
- /dictstackoverflow {/dictstackoverflow .error} def
- /dictstackunderflow {/dictstackunderflow .error} def
- /execstackoverflow {/execstackoverflow .error} def
- /interrupt {/interrupt .error} def
- /invalidaccess {/invalidaccess .error} def
- /invalidexit {/invalidexit .error} def
- /invalidfileaccess {/invalidfileaccess .error} def
- /invalidfont {/invalidfont .error} def
- /invalidrestore {/invalidrestore .error} def
- /ioerror {/ioerror .error} def
- /limitcheck {/limitcheck .error} def
- /nocurrentpoint {/nocurrentpoint .error} def
- /printererror {/printererror .error} def
- /rangecheck {/rangecheck .error} def
- /stackoverflow {/stackoverflow .error} def
- /stackunderflow {/stackunderflow .error} def
- /syntaxerror {/syntaxerror .error} def
- /timeout {/timeout .error} def
- /typecheck {/typecheck .error} def
- /undefinedfilename {/undefinedfilename .error} def
- /undefinedresource {/undefinedresource .error} def
- /undefinedresult {/undefinedresult .error} def
- /unimplemented {/unimplemented .error} def
- /unregistered {/unregistered .error} def
- /unmatchedmark {/unmatchedmark .error} def
- /VMerror {
- $error /errorname /VMerror put
- $error exch /command exch put
- $error /newerror true put
- stop
- } binddef
- /userdeferror1 {/userdeferror1 .error} def
- /userdeferror2 {/userdeferror2 .error} def
-
- end % errordict
-
-