Magick++ 6.9.13
Loading...
Searching...
No Matches
Exception.cpp
1// This may look like C code, but it is really -*- C++ -*-
2//
3// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
4// Copyright Dirk Lemstra 2014-2017
5//
6// Implementation of Exception and derived classes
7//
8
9#define MAGICKCORE_IMPLEMENTATION 1
10#define MAGICK_PLUSPLUS_IMPLEMENTATION 1
11
12#include "Magick++/Include.h"
13#include <string>
14#include <errno.h>
15#include <string.h>
16
17#include "Magick++/Exception.h"
18
19using namespace std;
20
21Magick::Exception::Exception(const std::string& what_)
22 : std::exception(),
23 _what(what_),
24 _nested((Exception *) NULL)
25{
26}
27
28Magick::Exception::Exception(const std::string& what_,
29 Exception* nested_)
30 : std::exception(),
31 _what(what_),
32 _nested(nested_)
33{
34}
35
36Magick::Exception::Exception(const Magick::Exception& original_)
37 : exception(original_),
38 _what(original_._what),
39 _nested((Exception *) NULL)
40{
41}
42
43Magick::Exception::~Exception() throw()
44{
45 if (_nested != (Exception *) NULL)
46 delete _nested;
47}
48
49Magick::Exception& Magick::Exception::operator=(
50 const Magick::Exception& original_)
51{
52 if (this != &original_)
53 this->_what=original_._what;
54 return(*this);
55}
56
57const char* Magick::Exception::what() const throw()
58{
59 return(_what.c_str());
60}
61
62const Magick::Exception* Magick::Exception::nested() const throw()
63{
64 return(_nested);
65}
66
67void Magick::Exception::nested(Exception* nested_) throw()
68{
69 _nested=nested_;
70}
71
72Magick::Error::Error(const std::string& what_)
73 : Exception(what_)
74{
75}
76
77Magick::Error::Error(const std::string& what_,Exception *nested_)
78 : Exception(what_,nested_)
79{
80}
81
82Magick::Error::~Error() throw()
83{
84}
85
86Magick::ErrorBlob::ErrorBlob(const std::string& what_)
87 : Error(what_)
88{
89}
90
91Magick::ErrorBlob::ErrorBlob(const std::string& what_,Exception *nested_)
92 : Error(what_,nested_)
93{
94}
95
96Magick::ErrorBlob::~ErrorBlob() throw()
97{
98}
99
100Magick::ErrorCache::ErrorCache(const std::string& what_)
101 : Error(what_)
102{
103}
104
105Magick::ErrorCache::ErrorCache(const std::string& what_,Exception *nested_)
106 : Error(what_,nested_)
107{
108}
109
110Magick::ErrorCache::~ErrorCache() throw()
111{
112}
113
114Magick::ErrorCoder::ErrorCoder(const std::string& what_)
115 : Error(what_)
116{
117}
118
119Magick::ErrorCoder::ErrorCoder(const std::string& what_,Exception *nested_)
120 : Error(what_,nested_)
121{
122}
123
124Magick::ErrorCoder::~ErrorCoder() throw()
125{
126}
127
128Magick::ErrorConfigure::ErrorConfigure(const std::string& what_)
129 : Error(what_)
130{
131}
132
133Magick::ErrorConfigure::ErrorConfigure(const std::string& what_,
134 Exception *nested_)
135 : Error(what_,nested_)
136{
137}
138
139Magick::ErrorConfigure::~ErrorConfigure() throw()
140{
141}
142
143Magick::ErrorCorruptImage::ErrorCorruptImage(const std::string& what_)
144 : Error(what_)
145{
146}
147
148Magick::ErrorCorruptImage::ErrorCorruptImage(const std::string& what_,
149 Exception *nested_)
150 : Error(what_,nested_)
151{
152}
153
154Magick::ErrorCorruptImage::~ErrorCorruptImage() throw()
155{
156}
157
158Magick::ErrorDelegate::ErrorDelegate(const std::string& what_)
159 : Error(what_)
160{
161}
162
163Magick::ErrorDelegate::ErrorDelegate(const std::string& what_,
164 Exception *nested_)
165 : Error(what_,nested_)
166{
167}
168
169Magick::ErrorDelegate::~ErrorDelegate()throw()
170{
171}
172
173Magick::ErrorDraw::ErrorDraw(const std::string& what_)
174 : Error(what_)
175{
176}
177
178Magick::ErrorDraw::ErrorDraw(const std::string& what_,Exception *nested_)
179 : Error(what_,nested_)
180{
181}
182
183Magick::ErrorDraw::~ErrorDraw() throw()
184{
185}
186
187Magick::ErrorFileOpen::ErrorFileOpen(const std::string& what_)
188 : Error(what_)
189{
190}
191
192Magick::ErrorFileOpen::~ErrorFileOpen() throw()
193{
194}
195
196Magick::ErrorFileOpen::ErrorFileOpen(const std::string& what_,
197 Exception *nested_)
198 : Error(what_,nested_)
199{
200}
201
202
203Magick::ErrorImage::ErrorImage(const std::string& what_)
204 : Error(what_)
205{
206}
207
208Magick::ErrorImage::ErrorImage(const std::string& what_,Exception *nested_)
209 : Error(what_,nested_)
210{
211}
212
213Magick::ErrorImage::~ErrorImage() throw()
214{
215}
216
217Magick::ErrorMissingDelegate::ErrorMissingDelegate(const std::string& what_)
218 : Error(what_)
219{
220}
221
222Magick::ErrorMissingDelegate::ErrorMissingDelegate(const std::string& what_,
223 Exception *nested_)
224 : Error(what_,nested_)
225{
226}
227
228Magick::ErrorMissingDelegate::~ErrorMissingDelegate() throw ()
229{
230}
231
232Magick::ErrorModule::ErrorModule(const std::string& what_)
233 : Error(what_)
234{
235}
236
237Magick::ErrorModule::ErrorModule(const std::string& what_,Exception *nested_)
238 : Error(what_,nested_)
239{
240}
241
242Magick::ErrorModule::~ErrorModule() throw()
243{
244}
245
246Magick::ErrorMonitor::ErrorMonitor(const std::string& what_)
247 : Error(what_)
248{
249}
250
251Magick::ErrorMonitor::ErrorMonitor(const std::string& what_,Exception *nested_)
252 : Error(what_,nested_)
253{
254}
255
256Magick::ErrorMonitor::~ErrorMonitor() throw()
257{
258}
259
260Magick::ErrorOption::ErrorOption(const std::string& what_)
261 : Error(what_)
262{
263}
264
265Magick::ErrorOption::ErrorOption(const std::string& what_,Exception *nested_)
266 : Error(what_,nested_)
267{
268}
269
270Magick::ErrorOption::~ErrorOption() throw()
271{
272}
273
274Magick::ErrorPolicy::ErrorPolicy(const std::string& what_)
275 : Error(what_)
276{
277}
278
279Magick::ErrorPolicy::ErrorPolicy(const std::string& what_,Exception *nested_)
280 : Error(what_,nested_)
281{
282}
283
284Magick::ErrorPolicy::~ErrorPolicy() throw()
285{
286}
287
288
289Magick::ErrorRegistry::ErrorRegistry(const std::string& what_)
290 : Error(what_)
291{
292}
293
294Magick::ErrorRegistry::ErrorRegistry(const std::string& what_,
295 Exception *nested_)
296 : Error(what_,nested_)
297{
298}
299
300Magick::ErrorRegistry::~ErrorRegistry() throw()
301{
302}
303
304Magick::ErrorResourceLimit::ErrorResourceLimit(const std::string& what_)
305 : Error(what_)
306{
307}
308
309Magick::ErrorResourceLimit::ErrorResourceLimit(const std::string& what_,
310 Exception *nested_)
311 : Error(what_,nested_)
312{
313}
314
315Magick::ErrorResourceLimit::~ErrorResourceLimit() throw()
316{
317}
318
319Magick::ErrorStream::ErrorStream(const std::string& what_)
320 : Error(what_)
321{
322}
323
324Magick::ErrorStream::ErrorStream(const std::string& what_,Exception *nested_)
325 : Error(what_,nested_)
326{
327}
328
329Magick::ErrorStream::~ErrorStream() throw()
330{
331}
332
333Magick::ErrorType::ErrorType(const std::string& what_)
334 : Error(what_)
335{
336}
337
338Magick::ErrorType::ErrorType(const std::string& what_,Exception *nested_)
339 : Error(what_,nested_)
340{
341}
342
343Magick::ErrorType::~ErrorType() throw()
344{
345}
346
347Magick::ErrorUndefined::ErrorUndefined(const std::string& what_)
348 : Error(what_)
349{
350}
351
352Magick::ErrorUndefined::ErrorUndefined(const std::string& what_,
353 Exception *nested_)
354 : Error(what_,nested_)
355{
356}
357
358Magick::ErrorUndefined::~ErrorUndefined() throw()
359{
360}
361
362Magick::ErrorXServer::ErrorXServer(const std::string& what_)
363 : Error(what_)
364{
365}
366
367Magick::ErrorXServer::ErrorXServer(const std::string& what_,Exception *nested_)
368 : Error(what_,nested_)
369{
370}
371
372Magick::ErrorXServer::~ErrorXServer() throw ()
373{
374}
375
376Magick::Warning::Warning(const std::string& what_)
377 : Exception(what_)
378{
379}
380
381Magick::Warning::Warning(const std::string& what_,Exception *nested_)
382 : Exception(what_,nested_)
383{
384}
385
386Magick::Warning::~Warning() throw()
387{
388}
389
390Magick::WarningBlob::WarningBlob(const std::string& what_)
391 : Warning(what_)
392{
393}
394
395Magick::WarningBlob::WarningBlob(const std::string& what_,Exception *nested_)
396 : Warning(what_,nested_)
397{
398}
399
400Magick::WarningBlob::~WarningBlob() throw()
401{
402}
403
404Magick::WarningCache::WarningCache(const std::string& what_)
405 : Warning(what_)
406{
407}
408
409Magick::WarningCache::WarningCache(const std::string& what_,Exception *nested_)
410 : Warning(what_,nested_)
411{
412}
413
414Magick::WarningCache::~WarningCache() throw()
415{
416}
417
418Magick::WarningCoder::WarningCoder(const std::string& what_)
419 : Warning(what_)
420{
421}
422
423Magick::WarningCoder::WarningCoder(const std::string& what_,Exception *nested_)
424 : Warning(what_,nested_)
425{
426}
427
428Magick::WarningCoder::~WarningCoder() throw()
429{
430}
431
432Magick::WarningConfigure::WarningConfigure(const std::string& what_)
433 : Warning(what_)
434{
435}
436
437Magick::WarningConfigure::WarningConfigure(const std::string& what_,
438 Exception *nested_)
439 : Warning(what_,nested_)
440{
441}
442
443Magick::WarningConfigure::~WarningConfigure() throw()
444{
445}
446
447Magick::WarningCorruptImage::WarningCorruptImage(const std::string& what_)
448 : Warning(what_)
449{
450}
451
452Magick::WarningCorruptImage::WarningCorruptImage(const std::string& what_,
453 Exception *nested_)
454 : Warning(what_,nested_)
455{
456}
457
458Magick::WarningCorruptImage::~WarningCorruptImage() throw()
459{
460}
461
462Magick::WarningDelegate::WarningDelegate(const std::string& what_)
463 : Warning(what_)
464{
465}
466
467Magick::WarningDelegate::WarningDelegate(const std::string& what_,
468 Exception *nested_)
469 : Warning(what_,nested_)
470{
471}
472
473Magick::WarningDelegate::~WarningDelegate() throw()
474{
475}
476
477Magick::WarningDraw::WarningDraw(const std::string& what_)
478 : Warning(what_)
479{
480}
481
482Magick::WarningDraw::WarningDraw(const std::string& what_,Exception *nested_)
483 : Warning(what_,nested_)
484{
485}
486
487Magick::WarningDraw::~WarningDraw() throw()
488{
489}
490
491Magick::WarningFileOpen::WarningFileOpen(const std::string& what_)
492 : Warning(what_)
493{
494}
495
496Magick::WarningFileOpen::WarningFileOpen(const std::string& what_,
497 Exception *nested_)
498 : Warning(what_,nested_)
499{
500}
501
502Magick::WarningFileOpen::~WarningFileOpen() throw()
503{
504}
505
506Magick::WarningImage::WarningImage(const std::string& what_)
507 : Warning(what_)
508{
509}
510
511Magick::WarningImage::WarningImage(const std::string& what_,Exception *nested_)
512 : Warning(what_,nested_)
513{
514}
515
516Magick::WarningImage::~WarningImage() throw()
517{
518}
519
520Magick::WarningMissingDelegate::WarningMissingDelegate(
521 const std::string& what_)
522 : Warning(what_)
523{
524}
525
526Magick::WarningMissingDelegate::WarningMissingDelegate(
527 const std::string& what_,Exception *nested_)
528 : Warning(what_,nested_)
529{
530}
531
532Magick::WarningMissingDelegate::~WarningMissingDelegate() throw()
533{
534}
535
536Magick::WarningModule::WarningModule(const std::string& what_)
537 : Warning(what_)
538{
539}
540
541Magick::WarningModule::WarningModule(const std::string& what_,
542 Exception *nested_)
543 : Warning(what_,nested_)
544{
545}
546
547
548Magick::WarningModule::~WarningModule() throw()
549{
550}
551
552Magick::WarningMonitor::WarningMonitor(const std::string& what_)
553 : Warning(what_)
554{
555}
556
557Magick::WarningMonitor::WarningMonitor(const std::string& what_,
558 Exception *nested_)
559 : Warning(what_,nested_)
560{
561}
562
563Magick::WarningMonitor::~WarningMonitor() throw()
564{
565}
566
567Magick::WarningOption::WarningOption(const std::string& what_)
568 : Warning(what_)
569{
570}
571
572Magick::WarningOption::WarningOption(const std::string& what_,
573 Exception *nested_)
574 : Warning(what_,nested_)
575{
576}
577
578Magick::WarningOption::~WarningOption() throw()
579{
580}
581
582Magick::WarningRegistry::WarningRegistry(const std::string& what_)
583 : Warning(what_)
584{
585}
586
587Magick::WarningRegistry::WarningRegistry(const std::string& what_,
588 Exception *nested_)
589 : Warning(what_,nested_)
590{
591}
592
593Magick::WarningRegistry::~WarningRegistry() throw()
594{
595}
596
597Magick::WarningPolicy::WarningPolicy(const std::string& what_)
598 : Warning(what_)
599{
600}
601
602Magick::WarningPolicy::WarningPolicy(const std::string& what_,
603 Exception *nested_)
604 : Warning(what_,nested_)
605{
606}
607
608Magick::WarningPolicy::~WarningPolicy() throw()
609{
610}
611
612Magick::WarningResourceLimit::WarningResourceLimit(const std::string& what_)
613 : Warning(what_)
614{
615}
616
617Magick::WarningResourceLimit::WarningResourceLimit(const std::string& what_,
618 Exception *nested_)
619 : Warning(what_,nested_)
620{
621}
622
623Magick::WarningResourceLimit::~WarningResourceLimit() throw()
624{
625}
626
627Magick::WarningStream::WarningStream(const std::string& what_)
628 : Warning(what_)
629{
630}
631
632Magick::WarningStream::WarningStream(const std::string& what_,
633 Exception *nested_)
634 : Warning(what_,nested_)
635{
636}
637
638Magick::WarningStream::~WarningStream() throw()
639{
640}
641
642Magick::WarningType::WarningType(const std::string& what_)
643 : Warning(what_)
644{
645}
646
647Magick::WarningType::WarningType(const std::string& what_,Exception *nested_)
648 : Warning(what_,nested_)
649{
650}
651
652Magick::WarningType::~WarningType() throw()
653{
654}
655
656Magick::WarningUndefined::WarningUndefined(const std::string& what_)
657 : Warning(what_)
658{
659}
660
661Magick::WarningUndefined::WarningUndefined(const std::string& what_,
662 Exception *nested_)
663 : Warning(what_,nested_)
664{
665}
666
667Magick::WarningUndefined::~WarningUndefined() throw()
668{
669}
670
671Magick::WarningXServer::WarningXServer(const std::string& what_)
672 : Warning(what_)
673{
674}
675
676Magick::WarningXServer::WarningXServer(const std::string& what_,
677 Exception *nested_)
678 : Warning(what_,nested_)
679{
680}
681
682Magick::WarningXServer::~WarningXServer() throw()
683{
684}
685
686std::string Magick::formatExceptionMessage(const MagickCore::ExceptionInfo *exception_)
687{
688 // Format error message ImageMagick-style
689 std::string message=GetClientName();
690 if (exception_->reason != (char *) NULL)
691 {
692 message+=std::string(": ");
693 message+=std::string(exception_->reason);
694 }
695
696 if (exception_->description != (char *) NULL)
697 message += " (" + std::string(exception_->description) + ")";
698 return(message);
699}
700
701Magick::Exception* Magick::createException(const MagickCore::ExceptionInfo *exception_)
702{
703 std::string message=formatExceptionMessage(exception_);
704 switch (exception_->severity)
705 {
706 case BlobError:
707 case BlobFatalError:
708 return new ErrorBlob(message);
709 case BlobWarning:
710 return new WarningBlob(message);
711 case CacheError:
712 case CacheFatalError:
713 return new ErrorCache(message);
714 case CacheWarning:
715 return new WarningCache(message);
716 case CoderError:
717 case CoderFatalError:
718 return new ErrorCoder(message);
719 case CoderWarning:
720 return new WarningCoder(message);
721 case ConfigureError:
722 case ConfigureFatalError:
723 return new ErrorConfigure(message);
724 case ConfigureWarning:
725 return new WarningConfigure(message);
726 case CorruptImageError:
727 case CorruptImageFatalError:
728 return new ErrorCorruptImage(message);
729 case CorruptImageWarning:
730 return new WarningCorruptImage(message);
731 case DelegateError:
732 case DelegateFatalError:
733 return new ErrorDelegate(message);
734 case DelegateWarning:
735 return new WarningDelegate(message);
736 case DrawError:
737 case DrawFatalError:
738 return new ErrorDraw(message);
739 case DrawWarning:
740 return new WarningDraw(message);
741 case FileOpenError:
742 case FileOpenFatalError:
743 return new ErrorFileOpen(message);
744 case FileOpenWarning:
745 return new WarningFileOpen(message);
746 case ImageError:
747 case ImageFatalError:
748 return new ErrorImage(message);
749 case ImageWarning:
750 return new WarningImage(message);
751 case MissingDelegateError:
752 case MissingDelegateFatalError:
753 return new ErrorMissingDelegate(message);
754 case MissingDelegateWarning:
755 return new WarningMissingDelegate(message);
756 case ModuleError:
757 case ModuleFatalError:
758 return new ErrorModule(message);
759 case ModuleWarning:
760 return new WarningModule(message);
761 case MonitorError:
762 case MonitorFatalError:
763 return new ErrorMonitor(message);
764 case MonitorWarning:
765 return new WarningMonitor(message);
766 case OptionError:
767 case OptionFatalError:
768 return new ErrorOption(message);
769 case OptionWarning:
770 return new WarningOption(message);
771 case PolicyWarning:
772 return new WarningPolicy(message);
773 case PolicyError:
774 case PolicyFatalError:
775 return new ErrorPolicy(message);
776 case RegistryError:
777 case RegistryFatalError:
778 return new ErrorRegistry(message);
779 case RegistryWarning:
780 return new WarningRegistry(message);
781 case ResourceLimitError:
782 case ResourceLimitFatalError:
783 return new ErrorResourceLimit(message);
784 case ResourceLimitWarning:
785 return new WarningResourceLimit(message);
786 case StreamError:
787 case StreamFatalError:
788 return new ErrorStream(message);
789 case StreamWarning:
790 return new WarningStream(message);
791 case TypeError:
792 case TypeFatalError:
793 return new ErrorType(message);
794 case TypeWarning:
795 return new WarningType(message);
796 case UndefinedException:
797 default:
798 return new ErrorUndefined(message);
799 case XServerError:
800 case XServerFatalError:
801 return new ErrorXServer(message);
802 case XServerWarning:
803 return new WarningXServer(message);
804 }
805}
806
807MagickPPExport void Magick::throwExceptionExplicit(
808 const ExceptionType severity_,const char* reason_,const char* description_)
809{
810 // Just return if there is no reported error
811 if (severity_ == UndefinedException)
812 return;
813
814 GetPPException;
815 ThrowException(exceptionInfo,severity_,reason_, description_);
816 ThrowPPException(false);
817}
818
819MagickPPExport void Magick::throwException(ExceptionInfo *exception_,
820 const bool quiet_)
821{
822 const ExceptionInfo
823 *p;
824
826 *nestedException,
827 *q;
828
829 ExceptionType
830 severity;
831
832 size_t
833 index;
834
835 // Just return if there is no reported error
836 if (exception_->severity == UndefinedException)
837 return;
838
839 std::string message=formatExceptionMessage(exception_);
840 nestedException=(Exception *) NULL;
841 q=(Exception *) NULL;
842 LockSemaphoreInfo(exception_->semaphore);
843 if (exception_->exceptions != (void *) NULL)
844 {
845 index=GetNumberOfElementsInLinkedList((LinkedListInfo *)
846 exception_->exceptions);
847 while(index > 0)
848 {
849 p=(const ExceptionInfo *) GetValueFromLinkedList((LinkedListInfo *)
850 exception_->exceptions,--index);
851 if ((p->severity != exception_->severity) || (LocaleCompare(p->reason,
852 exception_->reason) != 0) || (LocaleCompare(p->description,
853 exception_->description) != 0))
854 {
855 if (nestedException == (Exception *) NULL)
856 {
857 nestedException=createException(p);
858 q=nestedException;
859 }
860 else
861 {
863 *r;
864
865 r=createException(p);
866 q->nested(r);
867 q=r;
868 }
869 }
870 }
871 }
872 severity=exception_->severity;
873 UnlockSemaphoreInfo(exception_->semaphore);
874
875 if ((quiet_) && (severity < MagickCore::ErrorException))
876 {
877 delete nestedException;
878 return;
879 }
880
881 DestroyExceptionInfo(exception_);
882
883 switch (severity)
884 {
885 case BlobError:
886 case BlobFatalError:
887 throw ErrorBlob(message,nestedException);
888 case BlobWarning:
889 throw WarningBlob(message,nestedException);
890 case CacheError:
891 case CacheFatalError:
892 throw ErrorCache(message,nestedException);
893 case CacheWarning:
894 throw WarningCache(message,nestedException);
895 case CoderError:
896 case CoderFatalError:
897 throw ErrorCoder(message,nestedException);
898 case CoderWarning:
899 throw WarningCoder(message,nestedException);
900 case ConfigureError:
901 case ConfigureFatalError:
902 throw ErrorConfigure(message,nestedException);
903 case ConfigureWarning:
904 throw WarningConfigure(message,nestedException);
905 case CorruptImageError:
906 case CorruptImageFatalError:
907 throw ErrorCorruptImage(message,nestedException);
908 case CorruptImageWarning:
909 throw WarningCorruptImage(message,nestedException);
910 case DelegateError:
911 case DelegateFatalError:
912 throw ErrorDelegate(message,nestedException);
913 case DelegateWarning:
914 throw WarningDelegate(message,nestedException);
915 case DrawError:
916 case DrawFatalError:
917 throw ErrorDraw(message,nestedException);
918 case DrawWarning:
919 throw WarningDraw(message,nestedException);
920 case FileOpenError:
921 case FileOpenFatalError:
922 throw ErrorFileOpen(message,nestedException);
923 case FileOpenWarning:
924 throw WarningFileOpen(message,nestedException);
925 case ImageError:
926 case ImageFatalError:
927 throw ErrorImage(message,nestedException);
928 case ImageWarning:
929 throw WarningImage(message,nestedException);
930 case MissingDelegateError:
931 case MissingDelegateFatalError:
932 throw ErrorMissingDelegate(message,nestedException);
933 case MissingDelegateWarning:
934 throw WarningMissingDelegate(message,nestedException);
935 case ModuleError:
936 case ModuleFatalError:
937 throw ErrorModule(message,nestedException);
938 case ModuleWarning:
939 throw WarningModule(message,nestedException);
940 case MonitorError:
941 case MonitorFatalError:
942 throw ErrorMonitor(message,nestedException);
943 case MonitorWarning:
944 throw WarningMonitor(message,nestedException);
945 case OptionError:
946 case OptionFatalError:
947 throw ErrorOption(message,nestedException);
948 case OptionWarning:
949 throw WarningOption(message,nestedException);
950 case PolicyWarning:
951 throw WarningPolicy(message,nestedException);
952 case PolicyError:
953 case PolicyFatalError:
954 throw ErrorPolicy(message,nestedException);
955 case RegistryError:
956 case RegistryFatalError:
957 throw ErrorRegistry(message,nestedException);
958 case RegistryWarning:
959 throw WarningRegistry(message,nestedException);
960 case ResourceLimitError:
961 case ResourceLimitFatalError:
962 throw ErrorResourceLimit(message,nestedException);
963 case ResourceLimitWarning:
964 throw WarningResourceLimit(message,nestedException);
965 case StreamError:
966 case StreamFatalError:
967 throw ErrorStream(message,nestedException);
968 case StreamWarning:
969 throw WarningStream(message,nestedException);
970 case TypeError:
971 case TypeFatalError:
972 throw ErrorType(message,nestedException);
973 case TypeWarning:
974 throw WarningType(message,nestedException);
975 case UndefinedException:
976 default:
977 throw ErrorUndefined(message,nestedException);
978 case XServerError:
979 case XServerFatalError:
980 throw ErrorXServer(message,nestedException);
981 case XServerWarning:
982 throw WarningXServer(message,nestedException);
983 }
984}