Lines Matching full:exception
13 % MagickCore Exception Methods %
45 #include "MagickCore/exception.h"
46 #include "MagickCore/exception-private.h"
118 *exception; in AcquireExceptionInfo() local
120 exception=(ExceptionInfo *) AcquireCriticalMemory(sizeof(*exception)); in AcquireExceptionInfo()
121 InitializeExceptionInfo(exception); in AcquireExceptionInfo()
122 exception->relinquish=MagickTrue; in AcquireExceptionInfo()
123 return(exception); in AcquireExceptionInfo()
137 % ClearMagickException() clears any exception that may not have been caught
142 % ClearMagickException(ExceptionInfo *exception)
146 % o exception: the exception info.
150 static void *DestroyExceptionElement(void *exception) in DestroyExceptionElement() argument
155 p=(ExceptionInfo *) exception; in DestroyExceptionElement()
164 MagickExport void ClearMagickException(ExceptionInfo *exception) in ClearMagickException() argument
166 assert(exception != (ExceptionInfo *) NULL); in ClearMagickException()
167 assert(exception->signature == MagickCoreSignature); in ClearMagickException()
168 if (exception->exceptions == (void *) NULL) in ClearMagickException()
170 LockSemaphoreInfo(exception->semaphore); in ClearMagickException()
171 ClearLinkedList((LinkedListInfo *) exception->exceptions, in ClearMagickException()
173 exception->severity=UndefinedException; in ClearMagickException()
174 exception->reason=(char *) NULL; in ClearMagickException()
175 exception->description=(char *) NULL; in ClearMagickException()
176 UnlockSemaphoreInfo(exception->semaphore); in ClearMagickException()
192 % the exception as a warning, error, or fatal depending on the severity.
196 % CatchException(ExceptionInfo *exception)
200 % o exception: the exception info.
203 MagickExport void CatchException(ExceptionInfo *exception) in CatchException() argument
214 assert(exception != (ExceptionInfo *) NULL); in CatchException()
215 assert(exception->signature == MagickCoreSignature); in CatchException()
216 if (exception->exceptions == (void *) NULL) in CatchException()
218 LockSemaphoreInfo(exception->semaphore); in CatchException()
219 exceptions=(LinkedListInfo *) exception->exceptions; in CatchException()
232 UnlockSemaphoreInfo(exception->semaphore); in CatchException()
233 ClearMagickException(exception); in CatchException()
251 % ExceptionInfo *CloneException(ExceptionInfo *exception)
255 % o exception: the exception info.
258 MagickExport ExceptionInfo *CloneExceptionInfo(ExceptionInfo *exception) in CloneExceptionInfo() argument
263 clone_exception=(ExceptionInfo *) AcquireCriticalMemory(sizeof(*exception)); in CloneExceptionInfo()
265 InheritException(clone_exception,exception); in CloneExceptionInfo()
407 % DestroyExceptionInfo() deallocates memory associated with an exception.
411 % ExceptionInfo *DestroyExceptionInfo(ExceptionInfo *exception)
415 % o exception: the exception info.
418 MagickExport ExceptionInfo *DestroyExceptionInfo(ExceptionInfo *exception) in DestroyExceptionInfo() argument
423 assert(exception != (ExceptionInfo *) NULL); in DestroyExceptionInfo()
424 assert(exception->signature == MagickCoreSignature); in DestroyExceptionInfo()
425 if (exception->semaphore == (SemaphoreInfo *) NULL) in DestroyExceptionInfo()
426 ActivateSemaphoreInfo(&exception->semaphore); in DestroyExceptionInfo()
427 LockSemaphoreInfo(exception->semaphore); in DestroyExceptionInfo()
428 exception->severity=UndefinedException; in DestroyExceptionInfo()
429 if (exception->relinquish != MagickFalse) in DestroyExceptionInfo()
431 exception->signature=(~MagickCoreSignature); in DestroyExceptionInfo()
432 if (exception->exceptions != (void *) NULL) in DestroyExceptionInfo()
433 exception->exceptions=(void *) DestroyLinkedList((LinkedListInfo *) in DestroyExceptionInfo()
434 exception->exceptions,DestroyExceptionElement); in DestroyExceptionInfo()
437 if (exception->exceptions != (void *) NULL) in DestroyExceptionInfo()
438 ClearLinkedList((LinkedListInfo *) exception->exceptions, in DestroyExceptionInfo()
440 relinquish=exception->relinquish; in DestroyExceptionInfo()
441 UnlockSemaphoreInfo(exception->semaphore); in DestroyExceptionInfo()
444 RelinquishSemaphoreInfo(&exception->semaphore); in DestroyExceptionInfo()
445 exception=(ExceptionInfo *) RelinquishMagickMemory(exception); in DestroyExceptionInfo()
447 return(exception); in DestroyExceptionInfo()
461 % ExceptionComponentGenesis() instantiates the exception component.
486 % ExceptionComponentTerminus() destroys the exception component.
528 exception[MagickPathExtent]; in GetExceptionMessage() local
530 *exception='\0'; in GetExceptionMessage()
533 (void) strerror_r(error,exception,sizeof(exception)); in GetExceptionMessage()
535 (void) CopyMagickString(exception,strerror_r(error,exception, in GetExceptionMessage()
536 sizeof(exception)),sizeof(exception)); in GetExceptionMessage()
539 (void) CopyMagickString(exception,strerror(error),sizeof(exception)); in GetExceptionMessage()
541 return(ConstantString(exception)); in GetExceptionMessage()
555 % GetLocaleExceptionMessage() converts a enumerated exception severity and tag
565 % o severity: the severity of the exception.
653 (void) FormatLocaleString(message,MagickPathExtent,"Exception/%s%s", in GetLocaleExceptionMessage()
674 % InheritException() inherits an exception from a related exception.
678 % InheritException(ExceptionInfo *exception,const ExceptionInfo *relative)
682 % o exception: the exception info.
684 % o relative: the related exception info.
687 MagickExport void InheritException(ExceptionInfo *exception, in InheritException() argument
693 assert(exception != (ExceptionInfo *) NULL); in InheritException()
694 assert(exception->signature == MagickCoreSignature); in InheritException()
697 assert(exception != relative); in InheritException()
706 (void) ThrowException(exception,p->severity,p->reason,p->description); in InheritException()
724 % InitializeExceptionInfo() initializes an exception to default values.
728 % InitializeExceptionInfo(ExceptionInfo *exception)
732 % o exception: the exception info.
735 MagickPrivate void InitializeExceptionInfo(ExceptionInfo *exception) in InitializeExceptionInfo() argument
737 assert(exception != (ExceptionInfo *) NULL); in InitializeExceptionInfo()
738 (void) memset(exception,0,sizeof(*exception)); in InitializeExceptionInfo()
739 exception->severity=UndefinedException; in InitializeExceptionInfo()
740 exception->exceptions=(void *) NewLinkedList(0); in InitializeExceptionInfo()
741 exception->semaphore=AcquireSemaphoreInfo(); in InitializeExceptionInfo()
742 exception->signature=MagickCoreSignature; in InitializeExceptionInfo()
756 % MagickError() calls the exception handler methods with an error reason.
765 % o exception: Specifies the numeric error category.
791 % MagickFatalError() calls the fatal exception handler methods with an error
801 % o exception: Specifies the numeric error category.
861 % SetErrorHandler() sets the exception handler to the specified method
862 % and returns the previous exception handler.
898 % SetFatalErrorHandler() sets the fatal exception handler to the specified
899 % method and returns the previous fatal exception handler.
972 % ThrowException() throws an exception with the specified severity code,
977 % MagickBooleanType ThrowException(ExceptionInfo *exception,
983 % o exception: the exception info.
985 % o severity: the severity of the exception.
987 % o reason: the reason for the exception.
989 % o description: the exception description.
992 MagickExport MagickBooleanType ThrowException(ExceptionInfo *exception, in ThrowException() argument
1001 assert(exception != (ExceptionInfo *) NULL); in ThrowException()
1002 assert(exception->signature == MagickCoreSignature); in ThrowException()
1003 LockSemaphoreInfo(exception->semaphore); in ThrowException()
1004 exceptions=(LinkedListInfo *) exception->exceptions; in ThrowException()
1009 UnlockSemaphoreInfo(exception->semaphore); in ThrowException()
1015 UnlockSemaphoreInfo(exception->semaphore); in ThrowException()
1021 (LocaleCompare(exception->reason,reason) == 0) && in ThrowException()
1022 (LocaleCompare(exception->description,description) == 0)) in ThrowException()
1024 UnlockSemaphoreInfo(exception->semaphore); in ThrowException()
1030 UnlockSemaphoreInfo(exception->semaphore); in ThrowException()
1041 if (p->severity > exception->severity) in ThrowException()
1043 exception->severity=p->severity; in ThrowException()
1044 exception->reason=p->reason; in ThrowException()
1045 exception->description=p->description; in ThrowException()
1047 UnlockSemaphoreInfo(exception->semaphore); in ThrowException()
1049 (void) ThrowMagickException(exception,GetMagickModule(), in ThrowException()
1051 "(exception processing is suspended)"); in ThrowException()
1066 % ThrowMagickException logs an exception as determined by the log
1072 % MagickBooleanType ThrowFileException(ExceptionInfo *exception,
1078 % o exception: the exception info.
1095 ExceptionInfo *exception,const char *module,const char *function, in ThrowMagickExceptionList() argument
1117 assert(exception != (ExceptionInfo *) NULL); in ThrowMagickExceptionList()
1118 assert(exception->signature == MagickCoreSignature); in ThrowMagickExceptionList()
1141 (void) ThrowException(exception,severity,message,(char *) NULL); in ThrowMagickExceptionList()
1145 MagickExport MagickBooleanType ThrowMagickException(ExceptionInfo *exception, in ThrowMagickException() argument
1156 status=ThrowMagickExceptionList(exception,module,function,line,severity,tag, in ThrowMagickException()