summaryrefslogtreecommitdiff
path: root/www/api/error.html
blob: 922e53269e74ee5eb795afb900907b2ac5d2321f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta content="en" name="language">
	<title>error</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link media="screen" href="../docutils-api.css" type="text/css" rel="stylesheet">

</head>

<body>

<div class="banner">
<img src="../images/gm-107x76.png" alt="GraphicMagick logo" width="107" height="76" />
<span class="title">GraphicsMagick</span>
<form action="http://www.google.com/search">
  <input type="hidden" name="domains" value="www.graphicsmagick.org" />
  <input type="hidden" name="sitesearch" value="www.graphicsmagick.org" />
<span class="nowrap"><input type="text" name="q" size="25" maxlength="255" />&nbsp;<input type="submit" name="sa" value="Search" /></span>
</form>
</div>


<div class="navmenu">
<ul>
  <li><a href="../index.html">Home</a></li>
  <li><a href="../project.html">Project</a></li>
  <li><a href="../download.html">Download</a></li>
  <li><a href="../README.html">Install</a></li>
  <li><a href="../Hg.html">Source</a></li>
  <li><a href="../NEWS.html">News</a> </li>
  <li><a href="../utilities.html">Utilities</a></li>
  <li><a href="../programming.html">Programming</a></li>
  <li><a href="../reference.html">Reference</a></li>
</ul>
</div>

<div class="document" id="error">
<h1 class="title">error</h1>
<p class="subtitle" id="error-reporting-methods">Error reporting methods</p>
<div class="contents topic" id="contents">
<p class="topic-title">Contents</p>
<ul class="simple">
<li><p><a class="reference internal" href="#catchexception" id="id27">CatchException</a></p></li>
<li><p><a class="reference internal" href="#copyexception" id="id28">CopyException</a></p></li>
<li><p><a class="reference internal" href="#destroyexceptioninfo" id="id29">DestroyExceptionInfo</a></p></li>
<li><p><a class="reference internal" href="#getexceptioninfo" id="id30">GetExceptionInfo</a></p></li>
<li><p><a class="reference internal" href="#getlocaleexceptionmessage" id="id31">GetLocaleExceptionMessage</a></p></li>
<li><p><a class="reference internal" href="#magickerror" id="id32">MagickError</a></p></li>
<li><p><a class="reference internal" href="#magickfatalerror" id="id33">MagickFatalError</a></p></li>
<li><p><a class="reference internal" href="#magickwarning" id="id34">MagickWarning</a></p></li>
<li><p><a class="reference internal" href="#seterrorhandler" id="id35">SetErrorHandler</a></p></li>
<li><p><a class="reference internal" href="#setexceptioninfo" id="id36">SetExceptionInfo</a></p></li>
<li><p><a class="reference internal" href="#setfatalerrorhandler" id="id37">SetFatalErrorHandler</a></p></li>
<li><p><a class="reference internal" href="#setwarninghandler" id="id38">SetWarningHandler</a></p></li>
<li><p><a class="reference internal" href="#throwexception" id="id39">ThrowException</a></p></li>
<li><p><a class="reference internal" href="#throwloggedexception" id="id40">ThrowLoggedException</a></p></li>
</ul>
</div>
<div class="section" id="catchexception">
<h1><a class="toc-backref" href="#id27">CatchException</a></h1>
<div class="section" id="synopsis">
<h2>Synopsis</h2>
<pre class="literal-block">CatchException( const <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );</pre>
</div>
<div class="section" id="description">
<h2>Description</h2>
<p>CatchException() returns if no exceptions is found otherwise it reports
the exception as a warning, error, or fatal depending on the severity.</p>
<p>The format of the CatchException method is:</p>
<pre class="literal-block">CatchException( const <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>exception:</dt>
<dd><p>The exception info.</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="copyexception">
<h1><a class="toc-backref" href="#id28">CopyException</a></h1>
<div class="section" id="id1">
<h2>Synopsis</h2>
<pre class="literal-block">void CopyException( <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *copy, const <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *original );</pre>
</div>
<div class="section" id="id2">
<h2>Description</h2>
<p>CopyException() copies exception data from one ExceptionInfo structure
to another.</p>
<p>The format of the CopyException method is:</p>
<pre class="literal-block">void CopyException( <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *copy, const <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *original );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>copy:</dt>
<dd><p>The exception to copy to.</p>
</dd>
<dt>original:</dt>
<dd><p>The exception to copy from.</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="destroyexceptioninfo">
<h1><a class="toc-backref" href="#id29">DestroyExceptionInfo</a></h1>
<div class="section" id="id3">
<h2>Synopsis</h2>
<pre class="literal-block">void DestroyExceptionInfo( <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );</pre>
</div>
<div class="section" id="id4">
<h2>Description</h2>
<p>DestroyExceptionInfo() deallocates memory associated with exception.</p>
<p>The format of the DestroyExceptionInfo method is:</p>
<pre class="literal-block">void DestroyExceptionInfo( <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>exception:</dt>
<dd><p>The exception info.</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="getexceptioninfo">
<h1><a class="toc-backref" href="#id30">GetExceptionInfo</a></h1>
<div class="section" id="id5">
<h2>Synopsis</h2>
<pre class="literal-block">GetExceptionInfo( <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );</pre>
</div>
<div class="section" id="id6">
<h2>Description</h2>
<p>GetExceptionInfo() initializes an exception to default values.</p>
<p>The format of the GetExceptionInfo method is:</p>
<pre class="literal-block">GetExceptionInfo( <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>exception:</dt>
<dd><p>The exception info.</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="getlocaleexceptionmessage">
<h1><a class="toc-backref" href="#id31">GetLocaleExceptionMessage</a></h1>
<div class="section" id="id7">
<h2>Synopsis</h2>
<pre class="literal-block">const char *GetLocaleExceptionMessage( const <a class="reference external" href="../api/types.html#exceptiontype">ExceptionType</a> severity, const char *tag );</pre>
</div>
<div class="section" id="id8">
<h2>Description</h2>
<p>GetLocaleExceptionMessage() converts a enumerated exception severity and tag
to a message in the current locale.</p>
<p>The format of the GetLocaleExceptionMessage method is:</p>
<pre class="literal-block">const char *GetLocaleExceptionMessage( const <a class="reference external" href="../api/types.html#exceptiontype">ExceptionType</a> severity, const char *tag );</pre>
<dl class="simple">
<dt>severity:</dt>
<dd><p>the severity of the exception.</p>
</dd>
<dt>tag:</dt>
<dd><p>the message tag.</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="magickerror">
<h1><a class="toc-backref" href="#id32">MagickError</a></h1>
<div class="section" id="id9">
<h2>Synopsis</h2>
<pre class="literal-block">void MagickError( const <a class="reference external" href="../api/types.html#exceptiontype">ExceptionType</a> error, const char *reason, const char *description );</pre>
</div>
<div class="section" id="id10">
<h2>Description</h2>
<p>Method MagickError calls the error handler methods with an error reason.</p>
<p>The format of the MagickError method is:</p>
<pre class="literal-block">void MagickError( const <a class="reference external" href="../api/types.html#exceptiontype">ExceptionType</a> error, const char *reason, const char *description );</pre>
<dl class="simple">
<dt>exception:</dt>
<dd><p>Specifies the numeric error category.</p>
</dd>
<dt>reason:</dt>
<dd><p>Specifies the reason to display before terminating the
program.</p>
</dd>
<dt>description:</dt>
<dd><p>Specifies any description to the reason.</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="magickfatalerror">
<h1><a class="toc-backref" href="#id33">MagickFatalError</a></h1>
<div class="section" id="id11">
<h2>Synopsis</h2>
<pre class="literal-block">void MagickFatalError( const <a class="reference external" href="../api/types.html#exceptiontype">ExceptionType</a> error, const char *reason,
                       const char *description );</pre>
</div>
<div class="section" id="id12">
<h2>Description</h2>
<p>MagickFatalError() calls the fatal error handler methods with an error
reason.  The fatal error handler is not expected to return!</p>
<p>The format of the MagickFatalError method is:</p>
<pre class="literal-block">void MagickFatalError( const <a class="reference external" href="../api/types.html#exceptiontype">ExceptionType</a> error, const char *reason,
                       const char *description );</pre>
<dl class="simple">
<dt>exception:</dt>
<dd><p>Specifies the numeric error category.</p>
</dd>
<dt>reason:</dt>
<dd><p>Specifies the reason to display before terminating the
program.</p>
</dd>
<dt>description:</dt>
<dd><p>Specifies any description to the reason.</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="magickwarning">
<h1><a class="toc-backref" href="#id34">MagickWarning</a></h1>
<div class="section" id="id13">
<h2>Synopsis</h2>
<pre class="literal-block">void MagickWarning( const <a class="reference external" href="../api/types.html#exceptiontype">ExceptionType</a> warning, const char *reason,
                    const char *description );</pre>
</div>
<div class="section" id="id14">
<h2>Description</h2>
<p>Method MagickWarning calls the warning handler methods with a warning
reason.</p>
<p>The format of the MagickWarning method is:</p>
<pre class="literal-block">void MagickWarning( const <a class="reference external" href="../api/types.html#exceptiontype">ExceptionType</a> warning, const char *reason,
                    const char *description );</pre>
<dl class="simple">
<dt>warning:</dt>
<dd><p>The warning severity.</p>
</dd>
<dt>reason:</dt>
<dd><p>Define the reason for the warning.</p>
</dd>
<dt>description:</dt>
<dd><p>Describe the warning.</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="seterrorhandler">
<h1><a class="toc-backref" href="#id35">SetErrorHandler</a></h1>
<div class="section" id="id15">
<h2>Synopsis</h2>
<pre class="literal-block"><a class="reference external" href="../api/types.html#errorhandler">ErrorHandler</a> SetErrorHandler( <a class="reference external" href="../api/types.html#errorhandler">ErrorHandler</a> handler );</pre>
</div>
<div class="section" id="id16">
<h2>Description</h2>
<p>SetErrorHandler() sets the error handler to the specified method
and returns the previous error handler.</p>
<p>The format of the SetErrorHandler method is:</p>
<pre class="literal-block"><a class="reference external" href="../api/types.html#errorhandler">ErrorHandler</a> SetErrorHandler( <a class="reference external" href="../api/types.html#errorhandler">ErrorHandler</a> handler );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>handler:</dt>
<dd><p>The method to handle errors.</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="setexceptioninfo">
<h1><a class="toc-backref" href="#id36">SetExceptionInfo</a></h1>
<div class="section" id="id17">
<h2>Synopsis</h2>
<pre class="literal-block">SetExceptionInfo( <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception, <a class="reference external" href="../api/types.html#exceptiontype">ExceptionType</a> severity );</pre>
</div>
<div class="section" id="id18">
<h2>Description</h2>
<p>SetExceptionInfo() set the exception severity.</p>
<p>The format of the SetExceptionInfo method is:</p>
<pre class="literal-block">SetExceptionInfo( <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception, <a class="reference external" href="../api/types.html#exceptiontype">ExceptionType</a> severity );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>exception:</dt>
<dd><p>The exception info.</p>
</dd>
<dt>severity:</dt>
<dd><p>The exception severity.</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="setfatalerrorhandler">
<h1><a class="toc-backref" href="#id37">SetFatalErrorHandler</a></h1>
<div class="section" id="id19">
<h2>Synopsis</h2>
<pre class="literal-block">FatalErrorHandler SetFatalErrorHandler( FatalErrorHandler handler );</pre>
</div>
<div class="section" id="id20">
<h2>Description</h2>
<p>SetFatalErrorHandler() sets the fatal error handler to the specified method
and returns the previous fatal error handler.</p>
<p>The format of the SetFatalErrorHandler method is:</p>
<pre class="literal-block">FatalErrorHandler SetFatalErrorHandler( FatalErrorHandler handler );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>handler:</dt>
<dd><p>The method to handle errors.</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="setwarninghandler">
<h1><a class="toc-backref" href="#id38">SetWarningHandler</a></h1>
<div class="section" id="id21">
<h2>Synopsis</h2>
<pre class="literal-block"><a class="reference external" href="../api/types.html#errorhandler">ErrorHandler</a> SetWarningHandler( <a class="reference external" href="../api/types.html#errorhandler">ErrorHandler</a> handler );</pre>
</div>
<div class="section" id="id22">
<h2>Description</h2>
<p>SetWarningHandler() sets the warning handler to the specified method
and returns the previous warning handler.</p>
<p>The format of the SetWarningHandler method is:</p>
<pre class="literal-block"><a class="reference external" href="../api/types.html#errorhandler">ErrorHandler</a> SetWarningHandler( <a class="reference external" href="../api/types.html#errorhandler">ErrorHandler</a> handler );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>handler:</dt>
<dd><p>The method to handle warnings.</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="throwexception">
<h1><a class="toc-backref" href="#id39">ThrowException</a></h1>
<div class="section" id="id23">
<h2>Synopsis</h2>
<pre class="literal-block">void ThrowException( <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception, const <a class="reference external" href="../api/types.html#exceptiontype">ExceptionType</a> severity,
                     const char *reason, const char *description );</pre>
</div>
<div class="section" id="id24">
<h2>Description</h2>
<p>ThrowException() throws an exception with the specified severity code,
reason, and optional description.</p>
<p>The format of the ThrowException method is:</p>
<pre class="literal-block">void ThrowException( <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception, const <a class="reference external" href="../api/types.html#exceptiontype">ExceptionType</a> severity,
                     const char *reason, const char *description );</pre>
<dl class="simple">
<dt>exception:</dt>
<dd><p>The exception.</p>
</dd>
<dt>severity:</dt>
<dd><p>The severity of the exception.</p>
</dd>
<dt>reason:</dt>
<dd><p>The reason of the exception.</p>
</dd>
<dt>description:</dt>
<dd><p>The exception description.</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="throwloggedexception">
<h1><a class="toc-backref" href="#id40">ThrowLoggedException</a></h1>
<div class="section" id="id25">
<h2>Synopsis</h2>
<pre class="literal-block">void ThrowLoggedException( <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception, const <a class="reference external" href="../api/types.html#exceptiontype">ExceptionType</a> severity,
                           const char *reason, const char *description, const char *module,
                           const char *function, const unsigned long line ;</pre>
</div>
<div class="section" id="id26">
<h2>Description</h2>
<p>ThrowLoggedException() throws an exception with the specified severity code,
reason, optional description, source filename, function name, and line
number. If logging is enabled, the exception is also logged.</p>
<p>If the exception already contains an ErrorException (or greater) or the
existing exception is more severe, then it is ignored.</p>
<p>The format of the ThrowLoggedException method is:</p>
<pre class="literal-block">void ThrowLoggedException( <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception, const <a class="reference external" href="../api/types.html#exceptiontype">ExceptionType</a> severity,
                           const char *reason, const char *description, const char *module,
                           const char *function, const unsigned long line ;</pre>
<dl class="simple">
<dt>exception:</dt>
<dd><p>The exception.</p>
</dd>
<dt>severity:</dt>
<dd><p>The severity of the exception.</p>
</dd>
<dt>reason:</dt>
<dd><p>The reason of the exception.</p>
</dd>
<dt>description:</dt>
<dd><p>The exception description.</p>
</dd>
<dt>filename:</dt>
<dd><p>The source module filename.</p>
</dd>
<dt>function:</dt>
<dd><p>The function name.</p>
</dd>
<dt>line:</dt>
<dd><p>The line number of the source module.</p>
</dd>
</dl>
</div>
</div>
</div>


<hr class="docutils">
<div class="document">
    <p><a href="../Copyright.html">Copyright</a> © GraphicsMagick Group 2002 - 2023<!--SPONSOR_LOGO--></p>
</div>

</div>
</body>
</html>