3
<link rel="stylesheet" href="style.css" type="text/css">
4
<link rel="Start" href="index.html">
5
<link rel="previous" href="Pervasives.html">
6
<link rel="next" href="Printf.html">
7
<link rel="Up" href="index.html">
8
<link title="Index of types" rel="Appendix" href="index_types.html">
9
<link title="Index of exceptions" rel="Appendix" href="index_exceptions.html">
10
<link title="Index of values" rel="Appendix" href="index_values.html">
11
<link title="Index of class attributes" rel="Appendix" href="index_attributes.html">
12
<link title="Index of class methods" rel="Appendix" href="index_methods.html">
13
<link title="Index of classes" rel="Appendix" href="index_classes.html">
14
<link title="Index of class types" rel="Appendix" href="index_class_types.html">
15
<link title="Index of modules" rel="Appendix" href="index_modules.html">
16
<link title="Index of module types" rel="Appendix" href="index_module_types.html">
17
<link title="Arg" rel="Chapter" href="Arg.html">
19
<link title="Arith_status" rel="Chapter" href="Arith_status.html">
21
<link title="Array" rel="Chapter" href="Array.html">
23
<link title="ArrayLabels" rel="Chapter" href="ArrayLabels.html">
25
<link title="Big_int" rel="Chapter" href="Big_int.html">
27
<link title="Bigarray" rel="Chapter" href="Bigarray.html">
29
<link title="Buffer" rel="Chapter" href="Buffer.html">
31
<link title="Callback" rel="Chapter" href="Callback.html">
33
<link title="Char" rel="Chapter" href="Char.html">
35
<link title="Condition" rel="Chapter" href="Condition.html">
37
<link title="Dbm" rel="Chapter" href="Dbm.html">
39
<link title="Digest" rel="Chapter" href="Digest.html">
41
<link title="Dynlink" rel="Chapter" href="Dynlink.html">
43
<link title="Event" rel="Chapter" href="Event.html">
45
<link title="Filename" rel="Chapter" href="Filename.html">
47
<link title="Format" rel="Chapter" href="Format.html">
49
<link title="Gc" rel="Chapter" href="Gc.html">
51
<link title="Genlex" rel="Chapter" href="Genlex.html">
53
<link title="Graphics" rel="Chapter" href="Graphics.html">
55
<link title="GraphicsX11" rel="Chapter" href="GraphicsX11.html">
57
<link title="Hashtbl" rel="Chapter" href="Hashtbl.html">
59
<link title="Int32" rel="Chapter" href="Int32.html">
61
<link title="Int64" rel="Chapter" href="Int64.html">
63
<link title="Lazy" rel="Chapter" href="Lazy.html">
65
<link title="Lexing" rel="Chapter" href="Lexing.html">
67
<link title="List" rel="Chapter" href="List.html">
69
<link title="ListLabels" rel="Chapter" href="ListLabels.html">
71
<link title="Map" rel="Chapter" href="Map.html">
73
<link title="Marshal" rel="Chapter" href="Marshal.html">
75
<link title="MoreLabels" rel="Chapter" href="MoreLabels.html">
77
<link title="Mutex" rel="Chapter" href="Mutex.html">
79
<link title="Nativeint" rel="Chapter" href="Nativeint.html">
81
<link title="Num" rel="Chapter" href="Num.html">
83
<link title="Obj" rel="Chapter" href="Obj.html">
85
<link title="Oo" rel="Chapter" href="Oo.html">
87
<link title="Parsing" rel="Chapter" href="Parsing.html">
89
<link title="Pervasives" rel="Chapter" href="Pervasives.html">
91
<link title="Printexc" rel="Chapter" href="Printexc.html">
93
<link title="Printf" rel="Chapter" href="Printf.html">
95
<link title="Queue" rel="Chapter" href="Queue.html">
97
<link title="Random" rel="Chapter" href="Random.html">
99
<link title="Set" rel="Chapter" href="Set.html">
101
<link title="Sort" rel="Chapter" href="Sort.html">
103
<link title="Stack" rel="Chapter" href="Stack.html">
105
<link title="StdLabels" rel="Chapter" href="StdLabels.html">
107
<link title="Str" rel="Chapter" href="Str.html">
109
<link title="Stream" rel="Chapter" href="Stream.html">
111
<link title="String" rel="Chapter" href="String.html">
113
<link title="StringLabels" rel="Chapter" href="StringLabels.html">
115
<link title="Sys" rel="Chapter" href="Sys.html">
117
<link title="Thread" rel="Chapter" href="Thread.html">
119
<link title="ThreadUnix" rel="Chapter" href="ThreadUnix.html">
121
<link title="Tk" rel="Chapter" href="Tk.html">
123
<link title="Unix" rel="Chapter" href="Unix.html">
125
<link title="UnixLabels" rel="Chapter" href="UnixLabels.html">
127
<link title="Weak" rel="Chapter" href="Weak.html">
128
<title>Printexc</title>
131
<div class="navbar"><a href="Pervasives.html">Previous</a>
132
<a href="index.html">Up</a>
133
<a href="Printf.html">Next</a>
135
<center><h1>Module <a href="type_Printexc.html">Printexc</a></h1></center>
137
<pre><span class="keyword">module</span> Printexc = <code><span class="keyword">struct</span> ... <span class="keyword">end</span> </code></pre><div class="info">
138
Facilities for printing exceptions.<br>
141
<pre><span class="keyword">val</span> <a name="VALto_string"></a>to_string : <code class="type">exn -> string</code></pre><div class="info">
142
<code><span class="constructor">Printexc</span>.to_string e</code> returns a string representation of
143
the exception <code>e</code>.<br>
145
<pre><span class="keyword">val</span> <a name="VALprint"></a>print : <code class="type">('a -> 'b) -> 'a -> 'b</code></pre><div class="info">
146
<code><span class="constructor">Printexc</span>.print fn x</code> applies <code>fn</code> to <code>x</code> and returns the result.
147
If the evaluation of <code>fn x</code> raises any exception, the
148
name of the exception is printed on standard error output,
149
and the exception is raised again.
150
The typical use is to catch and report exceptions that
151
escape a function application.<br>
153
<pre><span class="keyword">val</span> <a name="VALcatch"></a>catch : <code class="type">('a -> 'b) -> 'a -> 'b</code></pre><div class="info">
154
<code><span class="constructor">Printexc</span>.catch fn x</code> is similar to <a href="Printexc.html#VALprint"><code><span class="constructor">Printexc</span>.print</code></a>, but
155
aborts the program with exit code 2 after printing the
156
uncaught exception. This function is deprecated: the runtime
157
system is now able to print uncaught exceptions as precisely
158
as <code><span class="constructor">Printexc</span>.catch</code> does. Moreover, calling <code><span class="constructor">Printexc</span>.catch</code>
159
makes it harder to track the location of the exception
160
using the debugger or the stack backtrace facility.
161
So, do not use <code><span class="constructor">Printexc</span>.catch</code> in new code.<br>
b'\\ No newline at end of file'