<?xml version="1.0" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>error - Error reporting methods</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rev="made" href="mailto:bfriesen@freddy.simplesystems.org" /> </head> <body style="background-color: white"> <P><a name="__index__"></a></P> <!-- INDEX BEGIN --> <ul> <li><a href="#name">NAME</a></li> <li><a href="#synopsis">SYNOPSIS</a></li> <li><a href="#function_descriptions">FUNCTION DESCRIPTIONS</a></li> <ul> <li><a href="#catchexception">CatchException</a></li> <li><a href="#copyexception">CopyException</a></li> <li><a href="#destroyexceptioninfo">DestroyExceptionInfo</a></li> <li><a href="#getexceptioninfo">GetExceptionInfo</a></li> <li><a href="#getlocaleexceptionmessage">GetLocaleExceptionMessage</a></li> <li><a href="#magickerror">MagickError</a></li> <li><a href="#magickfatalerror">MagickFatalError</a></li> <li><a href="#magickwarning">MagickWarning</a></li> <li><a href="#seterrorhandler">SetErrorHandler</a></li> <li><a href="#setexceptioninfo">SetExceptionInfo</a></li> <li><a href="#setfatalerrorhandler">SetFatalErrorHandler</a></li> <li><a href="#setwarninghandler">SetWarningHandler</a></li> <li><a href="#throwexception">ThrowException</a></li> <li><a href="#throwloggedexception">ThrowLoggedException</a></li> </ul> </ul> <!-- INDEX END --> <hr /> <P> </P> <h1><a name="name">NAME</a></h1> <P>error - Error reporting methods</P> <P> </P> <hr /> <h1><a name="synopsis">SYNOPSIS</a></h1> <P><strong>CatchException</strong>( const ExceptionInfo *exception );</P> <P>void <strong>CopyException</strong>( ExceptionInfo *copy, const ExceptionInfo *original );</P> <P>void <strong>DestroyExceptionInfo</strong>( ExceptionInfo *exception );</P> <P><strong>GetExceptionInfo</strong>( ExceptionInfo *exception );</P> <P>const char * <strong>GetLocaleExceptionMessage</strong>( const ExceptionType severity, const char *tag );</P> <P>void <strong>MagickError</strong>( const ExceptionType error, const char *reason, const char *description );</P> <P>void <strong>MagickFatalError</strong>( const ExceptionType error, const char *reason, const char *description );</P> <P>void <strong>MagickWarning</strong>( const ExceptionType warning, const char *reason, const char *description );</P> <P>ErrorHandler <strong>SetErrorHandler</strong>( ErrorHandler handler );</P> <P><strong>SetExceptionInfo</strong>( ExceptionInfo *exception, ExceptionType severity );</P> <P>ErrorHandler <strong>SetWarningHandler</strong>( ErrorHandler handler );</P> <P>void <strong>ThrowException</strong>( ExceptionInfo *exception, const ExceptionType severity, const char *reason, const char *description );</P> <P>void <strong>ThrowLoggedException</strong>( ExceptionInfo *exception, const ExceptionType severity, const char *reason, const char *description, const char *module, const char *function, const unsigned long line;</P> <P> </P> <hr /> <h1><a name="function_descriptions">FUNCTION DESCRIPTIONS</a></h1> <P> </P> <h2><a name="catchexception">CatchException</a></h2> <blockquote>CatchException() returns if no exceptions is found otherwise it reports the exception as a warning, error, or fatal depending on the severity. </blockquote><P>The format of the CatchException method is:</P> <blockquote>CatchException ( const <A HREF="types.html#ExceptionInfo">ExceptionInfo</A> *exception ); </blockquote><P>A description of each parameter follows:</P> <dl> <dt><strong><a name="item_o_exception_3a">exception:</a></strong> <DD> <P>The exception info.</P> </dd> </li> </dl> <P> </P> <h2><a name="copyexception">CopyException</a></h2> <blockquote>CopyException() copies exception data from one <A HREF="types.html#ExceptionInfo">ExceptionInfo</A> structure to another. </blockquote><P>The format of the CopyException method is:</P> <blockquote>void CopyException ( <A HREF="types.html#ExceptionInfo">ExceptionInfo</A> *copy, const <A HREF="types.html#ExceptionInfo">ExceptionInfo</A> *original ); </blockquote><P>A description of each parameter follows:</P> <dl> <dt><strong><a name="item_o_copy_3a">copy:</a></strong> <DD> <P>The exception to copy to.</P> </dd> </li> <dt><strong><a name="item_o_original_3a">original:</a></strong> <DD> <P>The exception to copy from.</P> </dd> </li> </dl> <P> </P> <h2><a name="destroyexceptioninfo">DestroyExceptionInfo</a></h2> <blockquote>DestroyExceptionInfo() deallocates memory associated with exception. </blockquote><P>The format of the DestroyExceptionInfo method is:</P> <blockquote>void DestroyExceptionInfo ( <A HREF="types.html#ExceptionInfo">ExceptionInfo</A> *exception ); </blockquote><P>A description of each parameter follows:</P> <dl> <dt><strong>exception:</strong> <DD> <P>The exception info.</P> </dd> </li> </dl> <P> </P> <h2><a name="getexceptioninfo">GetExceptionInfo</a></h2> <blockquote>GetExceptionInfo() initializes an exception to default values. </blockquote><P>The format of the GetExceptionInfo method is:</P> <blockquote>GetExceptionInfo ( <A HREF="types.html#ExceptionInfo">ExceptionInfo</A> *exception ); </blockquote><P>A description of each parameter follows:</P> <dl> <dt><strong>exception:</strong> <DD> <P>The exception info.</P> </dd> </li> </dl> <P> </P> <h2><a name="getlocaleexceptionmessage">GetLocaleExceptionMessage</a></h2> <blockquote>GetLocaleExceptionMessage() converts a enumerated exception severity and tag to a message in the current locale. </blockquote><P>The format of the GetLocaleExceptionMessage method is:</P> <blockquote>const char *GetLocaleExceptionMessage ( const <A HREF="types.html#ExceptionType">ExceptionType</A> severity, const char *tag ); </blockquote><P>A description of each parameter follows:</P> <dl> <dt><strong><a name="item_o_severity_3a">severity:</a></strong> <DD> <P>the severity of the exception.</P> </dd> </li> <dt><strong><a name="item_o_tag_3a">tag:</a></strong> <DD> <P>the message tag.</P> </dd> </li> </dl> <P> </P> <h2><a name="magickerror">MagickError</a></h2> <P>Method MagickError calls the error handler methods with an error reason.</P> <P>The format of the MagickError method is:</P> <blockquote>void MagickError ( const <A HREF="types.html#ExceptionType">ExceptionType</A> error, const char *reason, const char *description ); </blockquote><P>A description of each parameter follows:</P> <dl> <dt><strong>exception:</strong> <DD> <P>Specifies the numeric error category.</P> </dd> </li> <dt><strong><a name="item_o_reason_3a">reason:</a></strong> <DD> <P>Specifies the reason to display before terminating the program.</P> </dd> </li> <dt><strong><a name="item_o_description_3a">description:</a></strong> <DD> <P>Specifies any description to the reason.</P> </dd> </li> </dl> <P> </P> <h2><a name="magickfatalerror">MagickFatalError</a></h2> <blockquote>MagickFatalError() calls the fatal error handler methods with an error reason. </blockquote><P>The format of the MagickError method is:</P> <blockquote>void MagickFatalError ( const <A HREF="types.html#ExceptionType">ExceptionType</A> error, const char *reason, const char *description ); </blockquote><P>A description of each parameter follows:</P> <dl> <dt><strong>exception:</strong> <DD> <P>Specifies the numeric error category.</P> </dd> </li> <dt><strong>reason:</strong> <DD> <P>Specifies the reason to display before terminating the program.</P> </dd> </li> <dt><strong>description:</strong> <DD> <P>Specifies any description to the reason.</P> </dd> </li> </dl> <P> </P> <h2><a name="magickwarning">MagickWarning</a></h2> <P>Method MagickWarning calls the warning handler methods with a warning reason.</P> <P>The format of the MagickWarning method is:</P> <blockquote>void MagickWarning ( const <A HREF="types.html#ExceptionType">ExceptionType</A> warning, const char *reason, const char *description ); </blockquote><P>A description of each parameter follows:</P> <dl> <dt><strong><a name="item_o_warning_3a">warning:</a></strong> <DD> <P>The warning severity.</P> </dd> </li> <dt><strong>reason:</strong> <DD> <P>Define the reason for the warning.</P> </dd> </li> <dt><strong>description:</strong> <DD> <P>Describe the warning.</P> </dd> </li> </dl> <P> </P> <h2><a name="seterrorhandler">SetErrorHandler</a></h2> <blockquote>SetErrorHandler() sets the error handler to the specified method and returns the previous error handler. </blockquote><P>The format of the SetErrorHandler method is:</P> <blockquote><A HREF="types.html#ErrorHandler">ErrorHandler</A> SetErrorHandler ( <A HREF="types.html#ErrorHandler">ErrorHandler</A> handler ); </blockquote><P>A description of each parameter follows:</P> <dl> <dt><strong><a name="item_o_handler_3a">handler:</a></strong> <DD> <P>The method to handle errors.</P> </dd> </li> </dl> <P> </P> <h2><a name="setexceptioninfo">SetExceptionInfo</a></h2> <blockquote>SetExceptionInfo() set the exception severity. </blockquote><P>The format of the SetExceptionInfo method is:</P> <blockquote>SetExceptionInfo ( <A HREF="types.html#ExceptionInfo">ExceptionInfo</A> *exception, <A HREF="types.html#ExceptionType">ExceptionType</A> severity ); </blockquote><P>A description of each parameter follows:</P> <dl> <dt><strong>exception:</strong> <DD> <P>The exception info.</P> </dd> </li> <dt><strong>severity:</strong> <DD> <P>The exception severity.</P> </dd> </li> </dl> <P> </P> <h2><a name="setfatalerrorhandler">SetFatalErrorHandler</a></h2> <blockquote>SetFatalErrorHandler() sets the fatal error handler to the specified method and returns the previous fatal error handler. </blockquote><P>The format of the SetErrorHandler method is:</P> <pre> ErrorHandler SetErrorHandler(ErrorHandler handler)</pre> <P>A description of each parameter follows:</P> <dl> <dt><strong>handler:</strong> <DD> <P>The method to handle errors.</P> </dd> </li> </dl> <P> </P> <h2><a name="setwarninghandler">SetWarningHandler</a></h2> <blockquote>SetWarningHandler() sets the warning handler to the specified method and returns the previous warning handler. </blockquote><P>The format of the SetWarningHandler method is:</P> <blockquote><A HREF="types.html#ErrorHandler">ErrorHandler</A> SetWarningHandler ( <A HREF="types.html#ErrorHandler">ErrorHandler</A> handler ); </blockquote><P>A description of each parameter follows:</P> <dl> <dt><strong>handler:</strong> <DD> <P>The method to handle warnings.</P> </dd> </li> </dl> <P> </P> <h2><a name="throwexception">ThrowException</a></h2> <blockquote>ThrowException() throws an exception with the specified severity code, reason, and optional description. </blockquote><P>The format of the ThrowException method is:</P> <blockquote>void ThrowException ( <A HREF="types.html#ExceptionInfo">ExceptionInfo</A> *exception, const <A HREF="types.html#ExceptionType">ExceptionType</A> severity, const char *reason, const char *description ); </blockquote><P>A description of each parameter follows:</P> <dl> <dt><strong>exception:</strong> <DD> <P>The exception.</P> </dd> </li> <dt><strong>severity:</strong> <DD> <P>The severity of the exception.</P> </dd> </li> <dt><strong>reason:</strong> <DD> <P>The reason of the exception.</P> </dd> </li> <dt><strong>description:</strong> <DD> <P>The exception description.</P> </dd> </li> </dl> <P> </P> <h2><a name="throwloggedexception">ThrowLoggedException</a></h2> <blockquote>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. </blockquote><P>The format of the ThrowLoggedException method is:</P> <pre> void ThrowLoggedException( ExceptionInfo *exception, const ExceptionType severity, const char *reason, const char *description, const char *module, const char *function, const unsigned long line;</pre> <P>A description of each parameter follows:</P> <dl> <dt><strong>exception:</strong> <DD> <P>The exception.</P> </dd> </li> <dt><strong>severity:</strong> <DD> <P>The severity of the exception.</P> </dd> </li> <dt><strong>reason:</strong> <DD> <P>The reason of the exception.</P> </dd> </li> <dt><strong>description:</strong> <DD> <P>The exception description.</P> </dd> </li> <dt><strong><a name="item_o_filename_3a">filename:</a></strong> <DD> <P>The source module filename.</P> </dd> </li> <dt><strong><a name="item_o_function_3a">function:</a></strong> <DD> <P>The function name.</P> </dd> </li> <dt><strong><a name="item_o_line_3a">line:</a></strong> <DD> <P>The line number of the source module.</P> </dd> </dl> </body> </html>