1%-*-mode:latex-*-
2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3%
4% Copyright (C) 1996-2005 Jason Evans <jasone@canonware.com>.
5% All rights reserved.
6%
7% Redistribution and use in source and binary forms, with or without
8% modification, are permitted provided that the following conditions
9% are met:
10% 1. Redistributions of source code must retain the above copyright
11%    notice(s), this list of conditions and the following disclaimer
12%    unmodified other than the allowable addition of one or more
13%    copyright notices.
14% 2. Redistributions in binary form must reproduce the above copyright
15%    notice(s), this list of conditions and the following disclaimer in
16%    the documentation and/or other materials provided with the
17%    distribution.
18%
19% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
20% EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22% PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE
23% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
26% BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27% WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
28% OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29% EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30%
31%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
32%
33% Version: Onyx 5.1.2
34%
35% errordict reference portion of Onyx Manual.
36%
37%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38
39\subsection{errordict}
40\label{sec:errordict}
41\index{errordict@\onyxop{}{errordict}{}}
42
43Each thread has its own errordict, which is used by default by the error
44handling machinery.
45
46\begin{longtable}{\optableformat{4.10}}
47\caption{errordict summary} \\
48\hline
49\optableent
50	{Input(s)}
51	{Op/Proc/Var}
52	{Output(s)}
53	{Description}
54\hline \hline
55%begin{latexonly}
56\endfirsthead
57\caption[]{\emph{continued}} \\
58\hline
59\optableent
60	{Input(s)}
61	{Op/Proc/Var}
62	{Output(s)}
63	{Description}
64\hline \hline \endhead
65\multicolumn{2}{r}{\emph{Continued on next page...}} \endfoot
66\hline \endlastfoot
67%end{latexonly}
68\optableent
69	{--}
70	{{\bf \htmlref{handleerror}{errordict:handleerror}}}
71	{--}
72	{Print a state dump.}
73\hline
74\optableent
75	{--}
76	{{\bf \htmlref{stop}{errordict:stop}}}
77	{--}
78	{Last operation during error handling.}
79\end{longtable}
80
81\begin{description}
82\label{handleerror}
83\label{errordict:handleerror}
84\index{handleerror@\onyxop{}{handleerror}{}}
85\item[{\onyxop{--}{handleerror}{--}}: ]
86	\begin{description}\item[]
87	\item[Input(s): ] None.
88	\item[Output(s): ] None.
89	\item[Error(s): ]
90		Under normal conditions, no errors occur.  However, it is
91		possible for the application to corrupt the error handling
92		machinery to the point that an error will occur.  If that
93		happens, the result is possible infinite recursion, and program
94		crashes are a real possibility.
95	\item[Description: ]
96		Print a dump of the most recent error recorded in the
97		currenterror dictionary.
98	\item[Example(s): ]\begin{verbatim}
99
100onyx:0> {true {true 1 sprint x y} if} eval
101true
102Error $undefined
103ostack: ()
104dstack: (-dict- -dict- -dict- -dict-)
105cstack: ()
106estack/istack trace (0..5):
1070:      x
1081: {
109        true
110        1
111        sprint
112 3:-->  x
113        y
114}
1152:      --if--
1163:      --eval--
1174:      -file-
1185:      --start--
119onyx:1> errordict begin handleerror end
120Error $undefined
121ostack: ()
122dstack: (-dict- -dict- -dict- -dict-)
123cstack: ()
124estack/istack trace (0..5):
1250:      x
1261: {
127        true
128        1
129        sprint
130 3:-->  x
131        y
132}
1332:      --if--
1343:      --eval--
1354:      -file-
1365:      --start--
137onyx:1>
138		\end{verbatim}
139	\end{description}
140\label{errordict:stop}
141\index{stop@\onyxop{}{stop}{}}
142\item[{\onyxop{--}{stop}{--}}: ]
143	\begin{description}\item[]
144	\item[Input(s): ] None.
145	\item[Output(s): ] None.
146	\item[Error(s): ] None.
147	\item[Description: ]
148		This is called as the very last operation when an error occurs.
149		Initially, its value is the same as that for the
150		\htmlref{\onyxop{}{stop}{}}{systemdict:stop} operator in
151		systemdict.
152	\item[Example(s): ]\begin{verbatim}
153
154onyx:0> errordict begin
155onyx:0> $stop {`Custom stop\n' print flush quit} def
156onyx:0> x
157Error $undefined
158ostack: ()
159dstack: (-dict- -dict- -dict- -dict- -dict-)
160cstack: ()
161estack/istack trace (0..2):
1620:      x
1631:      -file-
1642:      --start--
165Custom stop
166		\end{verbatim}
167	\end{description}
168\end{description}
169