%-*-mode:latex-*-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Copyright (C) 1996-2004 Jason Evans <jasone@canonware.com>.
% All rights reserved.
% 
% Redistribution and use in source and binary forms, with or without
% modification, are permitted provided that the following conditions
% are met:
% 1. Redistributions of source code must retain the above copyright
%    notice(s), this list of conditions and the following disclaimer
%    unmodified other than the allowable addition of one or more
%    copyright notices.
% 2. Redistributions in binary form must reproduce the above copyright
%    notice(s), this list of conditions and the following disclaimer in
%    the documentation and/or other materials provided with the
%    distribution.
% 
% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
% EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
% PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE
% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
% BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
% WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
% OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
% EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Version: Onyx 5.1.1
%
% errordict reference portion of Onyx Manual.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\subsection{errordict}
\label{sec:errordict}
\index{errordict@\onyxop{}{errordict}{}}

Each thread has its own errordict, which is used by default by the error
handling machinery.

\begin{longtable}{\optableformat{4.10}}
\caption{errordict summary} \\
\hline
\optableent
	{Input(s)}
	{Op/Proc/Var}
	{Output(s)}
	{Description}
\hline \hline
%begin{latexonly}
\endfirsthead
\caption[]{\emph{continued}} \\
\hline
\optableent
	{Input(s)}
	{Op/Proc/Var}
	{Output(s)}
	{Description}
\hline \hline \endhead
\multicolumn{2}{r}{\emph{Continued on next page...}} \endfoot
\hline \endlastfoot
%end{latexonly}
\optableent
	{--}
	{{\bf \htmlref{handleerror}{errordict:handleerror}}}
	{--}
	{Print a state dump.}
\hline
\optableent
	{--}
	{{\bf \htmlref{stop}{errordict:stop}}}
	{--}
	{Last operation during error handling.}
\end{longtable}

\begin{description}
\label{handleerror}
\label{errordict:handleerror}
\index{handleerror@\onyxop{}{handleerror}{}}
\item[{\onyxop{--}{handleerror}{--}}: ]
	\begin{description}\item[]
	\item[Input(s): ] None.
	\item[Output(s): ] None.
	\item[Error(s): ]
		Under normal conditions, no errors occur.  However, it is
		possible for the application to corrupt the error handling
		machinery to the point that an error will occur.  If that
		happens, the result is possible infinite recursion, and program
		crashes are a real possibility.
	\item[Description: ]
		Print a dump of the most recent error recorded in the
		currenterror dictionary.
	\item[Example(s): ]\begin{verbatim}

onyx:0> {true {true 1 sprint x y} if} eval
true
Error $undefined
ostack: ()
dstack: (-dict- -dict- -dict- -dict-)
cstack: ()
estack/istack trace (0..5):
0:      x
1: {
        true
        1
        sprint
 3:-->  x
        y
}
2:      --if--
3:      --eval--
4:      -file-
5:      --start--
onyx:1> errordict begin handleerror end
Error $undefined
ostack: ()
dstack: (-dict- -dict- -dict- -dict-)
cstack: ()
estack/istack trace (0..5):
0:      x
1: {
        true
        1
        sprint
 3:-->  x
        y
}
2:      --if--
3:      --eval--
4:      -file-
5:      --start--
onyx:1>
		\end{verbatim}
	\end{description}
\label{errordict:stop}
\index{stop@\onyxop{}{stop}{}}
\item[{\onyxop{--}{stop}{--}}: ]
	\begin{description}\item[]
	\item[Input(s): ] None.
	\item[Output(s): ] None.
	\item[Error(s): ] None.
	\item[Description: ]
		This is called as the very last operation when an error occurs.
		Initially, its value is the same as that for the
		\htmlref{\onyxop{}{stop}{}}{systemdict:stop} operator in
		systemdict.
	\item[Example(s): ]\begin{verbatim}

onyx:0> errordict begin
onyx:0> $stop {`Custom stop\n' print flush quit} def
onyx:0> x
Error $undefined
ostack: ()
dstack: (-dict- -dict- -dict- -dict- -dict-)
cstack: ()
estack/istack trace (0..2):
0:      x
1:      -file-
2:      --start--
Custom stop
		\end{verbatim}
	\end{description}
\end{description}
