wand.exceptions
— Errors and warnings¶
This module maps MagickWand API’s errors and warnings to Python’s native exceptions and warnings. You can catch all MagickWand errors using Python’s natural way to catch errors.
See also
New in version 0.1.1.
-
exception
wand.exceptions.
BaseError
¶ Bases:
wand.exceptions.WandException
Base class for Wand-related errors.
New in version 0.4.4.
-
exception
wand.exceptions.
BaseFatalError
¶ Bases:
wand.exceptions.WandException
Base class for Wand-related fatal errors.
New in version 0.4.4.
-
exception
wand.exceptions.
BaseWarning
¶ Bases:
wand.exceptions.WandException
,exceptions.Warning
Base class for Wand-related warnings.
New in version 0.4.4.
-
exception
wand.exceptions.
BlobError
¶ Bases:
wand.exceptions.BaseError
,exceptions.IOError
A binary large object could not be allocated, read, or written.
-
exception
wand.exceptions.
BlobFatalError
¶ Bases:
wand.exceptions.BaseFatalError
,exceptions.IOError
A binary large object could not be allocated, read, or written.
-
exception
wand.exceptions.
BlobWarning
¶ Bases:
wand.exceptions.BaseWarning
,exceptions.IOError
A binary large object could not be allocated, read, or written.
-
wand.exceptions.
CODE_MAP
= [(<class 'wand.exceptions.BaseWarning'>, 'Warning'), (<class 'wand.exceptions.BaseError'>, 'Error'), (<class 'wand.exceptions.BaseFatalError'>, 'FatalError')]¶ (
list
) The list of (base_class, suffix) pairs (for each code). It would be zipped withDOMAIN_MAP
pairs’ last element.
-
exception
wand.exceptions.
CacheError
¶ Bases:
wand.exceptions.BaseError
Pixels could not be read or written to the pixel cache.
-
exception
wand.exceptions.
CacheFatalError
¶ Bases:
wand.exceptions.BaseFatalError
Pixels could not be read or written to the pixel cache.
-
exception
wand.exceptions.
CacheWarning
¶ Bases:
wand.exceptions.BaseWarning
Pixels could not be read or written to the pixel cache.
-
exception
wand.exceptions.
CoderError
¶ Bases:
wand.exceptions.BaseError
There was a problem with an image coder.
-
exception
wand.exceptions.
CoderFatalError
¶ Bases:
wand.exceptions.BaseFatalError
There was a problem with an image coder.
-
exception
wand.exceptions.
CoderWarning
¶ Bases:
wand.exceptions.BaseWarning
There was a problem with an image coder.
-
exception
wand.exceptions.
ConfigureError
¶ Bases:
wand.exceptions.BaseError
There was a problem getting a configuration file.
-
exception
wand.exceptions.
ConfigureFatalError
¶ Bases:
wand.exceptions.BaseFatalError
There was a problem getting a configuration file.
-
exception
wand.exceptions.
ConfigureWarning
¶ Bases:
wand.exceptions.BaseWarning
There was a problem getting a configuration file.
-
exception
wand.exceptions.
CorruptImageError
¶ Bases:
wand.exceptions.BaseError
,exceptions.ValueError
The image file may be corrupt.
-
exception
wand.exceptions.
CorruptImageFatalError
¶ Bases:
wand.exceptions.BaseFatalError
,exceptions.ValueError
The image file may be corrupt.
-
exception
wand.exceptions.
CorruptImageWarning
¶ Bases:
wand.exceptions.BaseWarning
,exceptions.ValueError
The image file may be corrupt.
-
wand.exceptions.
DOMAIN_MAP
= [('ResourceLimit', 'A program resource is exhausted e.g. not enough memory.', (<type 'exceptions.MemoryError'>,), [300, 400, 700]), ('Type', 'A font is unavailable; a substitution may have occurred.', (), [305, 405, 705]), ('Option', 'A command-line option was malformed.', (), [310, 410, 710]), ('Delegate', 'An ImageMagick delegate failed to complete.', (), [315, 415, 715]), ('MissingDelegate', 'The image type can not be read or written because the appropriate; delegate is missing.', (<type 'exceptions.ImportError'>,), [320, 420, 720]), ('CorruptImage', 'The image file may be corrupt.', (<type 'exceptions.ValueError'>,), [325, 425, 725]), ('FileOpen', 'The image file could not be opened for reading or writing.', (<type 'exceptions.IOError'>,), [330, 430, 730]), ('Blob', 'A binary large object could not be allocated, read, or written.', (<type 'exceptions.IOError'>,), [335, 435, 735]), ('Stream', 'There was a problem reading or writing from a stream.', (<type 'exceptions.IOError'>,), [340, 440, 740]), ('Cache', 'Pixels could not be read or written to the pixel cache.', (), [345, 445, 745]), ('Coder', 'There was a problem with an image coder.', (), [350, 450, 750]), ('Module', 'There was a problem with an image module.', (), [355, 455, 755]), ('Draw', 'A drawing operation failed.', (), [360, 460, 760]), ('Image', 'The operation could not complete due to an incompatible image.', (), [365, 465, 765]), ('Wand', 'There was a problem specific to the MagickWand API.', (), [370, 470, 770]), ('Random', 'There is a problem generating a true or pseudo-random number.', (), [375, 475, 775]), ('XServer', 'An X resource is unavailable.', (), [380, 480, 780]), ('Monitor', 'There was a problem activating the progress monitor.', (), [385, 485, 785]), ('Registry', 'There was a problem getting or setting the registry.', (), [390, 490, 790]), ('Configure', 'There was a problem getting a configuration file.', (), [395, 495, 795]), ('Policy', 'A policy denies access to a delegate, coder, filter, path, or resource.', (), [399, 499, 799])]¶ (
list
) A list of error/warning domains, these descriptions and codes. The form of elements is like: (domain name, description, codes).
-
exception
wand.exceptions.
DelegateError
¶ Bases:
wand.exceptions.BaseError
An ImageMagick delegate failed to complete.
-
exception
wand.exceptions.
DelegateFatalError
¶ Bases:
wand.exceptions.BaseFatalError
An ImageMagick delegate failed to complete.
-
exception
wand.exceptions.
DelegateWarning
¶ Bases:
wand.exceptions.BaseWarning
An ImageMagick delegate failed to complete.
-
exception
wand.exceptions.
DrawError
¶ Bases:
wand.exceptions.BaseError
A drawing operation failed.
-
exception
wand.exceptions.
DrawFatalError
¶ Bases:
wand.exceptions.BaseFatalError
A drawing operation failed.
-
exception
wand.exceptions.
DrawWarning
¶ Bases:
wand.exceptions.BaseWarning
A drawing operation failed.
-
exception
wand.exceptions.
FileOpenError
¶ Bases:
wand.exceptions.BaseError
,exceptions.IOError
The image file could not be opened for reading or writing.
-
exception
wand.exceptions.
FileOpenFatalError
¶ Bases:
wand.exceptions.BaseFatalError
,exceptions.IOError
The image file could not be opened for reading or writing.
-
exception
wand.exceptions.
FileOpenWarning
¶ Bases:
wand.exceptions.BaseWarning
,exceptions.IOError
The image file could not be opened for reading or writing.
-
exception
wand.exceptions.
ImageError
¶ Bases:
wand.exceptions.BaseError
The operation could not complete due to an incompatible image.
-
exception
wand.exceptions.
ImageFatalError
¶ Bases:
wand.exceptions.BaseFatalError
The operation could not complete due to an incompatible image.
-
exception
wand.exceptions.
ImageWarning
¶ Bases:
wand.exceptions.BaseWarning
The operation could not complete due to an incompatible image.
-
exception
wand.exceptions.
MissingDelegateError
¶ Bases:
wand.exceptions.BaseError
,exceptions.ImportError
The image type can not be read or written because the appropriate; delegate is missing.
-
exception
wand.exceptions.
MissingDelegateFatalError
¶ Bases:
wand.exceptions.BaseFatalError
,exceptions.ImportError
The image type can not be read or written because the appropriate; delegate is missing.
-
exception
wand.exceptions.
MissingDelegateWarning
¶ Bases:
wand.exceptions.BaseWarning
,exceptions.ImportError
The image type can not be read or written because the appropriate; delegate is missing.
-
exception
wand.exceptions.
ModuleError
¶ Bases:
wand.exceptions.BaseError
There was a problem with an image module.
-
exception
wand.exceptions.
ModuleFatalError
¶ Bases:
wand.exceptions.BaseFatalError
There was a problem with an image module.
-
exception
wand.exceptions.
ModuleWarning
¶ Bases:
wand.exceptions.BaseWarning
There was a problem with an image module.
-
exception
wand.exceptions.
MonitorError
¶ Bases:
wand.exceptions.BaseError
There was a problem activating the progress monitor.
-
exception
wand.exceptions.
MonitorFatalError
¶ Bases:
wand.exceptions.BaseFatalError
There was a problem activating the progress monitor.
-
exception
wand.exceptions.
MonitorWarning
¶ Bases:
wand.exceptions.BaseWarning
There was a problem activating the progress monitor.
-
exception
wand.exceptions.
OptionError
¶ Bases:
wand.exceptions.BaseError
A command-line option was malformed.
-
exception
wand.exceptions.
OptionFatalError
¶ Bases:
wand.exceptions.BaseFatalError
A command-line option was malformed.
-
exception
wand.exceptions.
OptionWarning
¶ Bases:
wand.exceptions.BaseWarning
A command-line option was malformed.
-
exception
wand.exceptions.
PolicyError
¶ Bases:
wand.exceptions.BaseError
A policy denies access to a delegate, coder, filter, path, or resource.
-
exception
wand.exceptions.
PolicyFatalError
¶ Bases:
wand.exceptions.BaseFatalError
A policy denies access to a delegate, coder, filter, path, or resource.
-
exception
wand.exceptions.
PolicyWarning
¶ Bases:
wand.exceptions.BaseWarning
A policy denies access to a delegate, coder, filter, path, or resource.
-
exception
wand.exceptions.
RandomError
¶ Bases:
wand.exceptions.BaseError
There is a problem generating a true or pseudo-random number.
-
exception
wand.exceptions.
RandomFatalError
¶ Bases:
wand.exceptions.BaseFatalError
There is a problem generating a true or pseudo-random number.
-
exception
wand.exceptions.
RandomWarning
¶ Bases:
wand.exceptions.BaseWarning
There is a problem generating a true or pseudo-random number.
-
exception
wand.exceptions.
RegistryError
¶ Bases:
wand.exceptions.BaseError
There was a problem getting or setting the registry.
-
exception
wand.exceptions.
RegistryFatalError
¶ Bases:
wand.exceptions.BaseFatalError
There was a problem getting or setting the registry.
-
exception
wand.exceptions.
RegistryWarning
¶ Bases:
wand.exceptions.BaseWarning
There was a problem getting or setting the registry.
-
exception
wand.exceptions.
ResourceLimitError
¶ Bases:
wand.exceptions.BaseError
,exceptions.MemoryError
A program resource is exhausted e.g. not enough memory.
-
exception
wand.exceptions.
ResourceLimitFatalError
¶ Bases:
wand.exceptions.BaseFatalError
,exceptions.MemoryError
A program resource is exhausted e.g. not enough memory.
-
exception
wand.exceptions.
ResourceLimitWarning
¶ Bases:
wand.exceptions.BaseWarning
,exceptions.MemoryError
A program resource is exhausted e.g. not enough memory.
-
exception
wand.exceptions.
StreamError
¶ Bases:
wand.exceptions.BaseError
,exceptions.IOError
There was a problem reading or writing from a stream.
-
exception
wand.exceptions.
StreamFatalError
¶ Bases:
wand.exceptions.BaseFatalError
,exceptions.IOError
There was a problem reading or writing from a stream.
-
exception
wand.exceptions.
StreamWarning
¶ Bases:
wand.exceptions.BaseWarning
,exceptions.IOError
There was a problem reading or writing from a stream.
-
wand.exceptions.
TYPE_MAP
= {300: <class 'wand.exceptions.ResourceLimitWarning'>, 305: <class 'wand.exceptions.TypeWarning'>, 310: <class 'wand.exceptions.OptionWarning'>, 315: <class 'wand.exceptions.DelegateWarning'>, 320: <class 'wand.exceptions.MissingDelegateWarning'>, 325: <class 'wand.exceptions.CorruptImageWarning'>, 330: <class 'wand.exceptions.FileOpenWarning'>, 335: <class 'wand.exceptions.BlobWarning'>, 340: <class 'wand.exceptions.StreamWarning'>, 345: <class 'wand.exceptions.CacheWarning'>, 350: <class 'wand.exceptions.CoderWarning'>, 355: <class 'wand.exceptions.ModuleWarning'>, 360: <class 'wand.exceptions.DrawWarning'>, 365: <class 'wand.exceptions.ImageWarning'>, 370: <class 'wand.exceptions.WandWarning'>, 375: <class 'wand.exceptions.RandomWarning'>, 380: <class 'wand.exceptions.XServerWarning'>, 385: <class 'wand.exceptions.MonitorWarning'>, 390: <class 'wand.exceptions.RegistryWarning'>, 395: <class 'wand.exceptions.ConfigureWarning'>, 399: <class 'wand.exceptions.PolicyWarning'>, 400: <class 'wand.exceptions.ResourceLimitError'>, 405: <class 'wand.exceptions.TypeError'>, 410: <class 'wand.exceptions.OptionError'>, 415: <class 'wand.exceptions.DelegateError'>, 420: <class 'wand.exceptions.MissingDelegateError'>, 425: <class 'wand.exceptions.CorruptImageError'>, 430: <class 'wand.exceptions.FileOpenError'>, 435: <class 'wand.exceptions.BlobError'>, 440: <class 'wand.exceptions.StreamError'>, 445: <class 'wand.exceptions.CacheError'>, 450: <class 'wand.exceptions.CoderError'>, 455: <class 'wand.exceptions.ModuleError'>, 460: <class 'wand.exceptions.DrawError'>, 465: <class 'wand.exceptions.ImageError'>, 470: <class 'wand.exceptions.WandError'>, 475: <class 'wand.exceptions.RandomError'>, 480: <class 'wand.exceptions.XServerError'>, 485: <class 'wand.exceptions.MonitorError'>, 490: <class 'wand.exceptions.RegistryError'>, 495: <class 'wand.exceptions.ConfigureError'>, 499: <class 'wand.exceptions.PolicyError'>, 700: <class 'wand.exceptions.ResourceLimitFatalError'>, 705: <class 'wand.exceptions.TypeFatalError'>, 710: <class 'wand.exceptions.OptionFatalError'>, 715: <class 'wand.exceptions.DelegateFatalError'>, 720: <class 'wand.exceptions.MissingDelegateFatalError'>, 725: <class 'wand.exceptions.CorruptImageFatalError'>, 730: <class 'wand.exceptions.FileOpenFatalError'>, 735: <class 'wand.exceptions.BlobFatalError'>, 740: <class 'wand.exceptions.StreamFatalError'>, 745: <class 'wand.exceptions.CacheFatalError'>, 750: <class 'wand.exceptions.CoderFatalError'>, 755: <class 'wand.exceptions.ModuleFatalError'>, 760: <class 'wand.exceptions.DrawFatalError'>, 765: <class 'wand.exceptions.ImageFatalError'>, 770: <class 'wand.exceptions.WandFatalError'>, 775: <class 'wand.exceptions.RandomFatalError'>, 780: <class 'wand.exceptions.XServerFatalError'>, 785: <class 'wand.exceptions.MonitorFatalError'>, 790: <class 'wand.exceptions.RegistryFatalError'>, 795: <class 'wand.exceptions.ConfigureFatalError'>, 799: <class 'wand.exceptions.PolicyFatalError'>}¶ (
dict
) The dictionary of (code, exc_type).
-
exception
wand.exceptions.
TypeError
¶ Bases:
wand.exceptions.BaseError
A font is unavailable; a substitution may have occurred.
-
exception
wand.exceptions.
TypeFatalError
¶ Bases:
wand.exceptions.BaseFatalError
A font is unavailable; a substitution may have occurred.
-
exception
wand.exceptions.
TypeWarning
¶ Bases:
wand.exceptions.BaseWarning
A font is unavailable; a substitution may have occurred.
-
exception
wand.exceptions.
WandError
¶ Bases:
wand.exceptions.BaseError
There was a problem specific to the MagickWand API.
-
exception
wand.exceptions.
WandException
¶ Bases:
exceptions.Exception
All Wand-related exceptions are derived from this class.
-
exception
wand.exceptions.
WandFatalError
¶ Bases:
wand.exceptions.BaseFatalError
There was a problem specific to the MagickWand API.
-
exception
wand.exceptions.
WandLibraryVersionError
¶ Bases:
wand.exceptions.WandException
Base class for Wand-related ImageMagick version errors.
New in version 0.3.2.
-
exception
wand.exceptions.
WandWarning
¶ Bases:
wand.exceptions.BaseWarning
There was a problem specific to the MagickWand API.
-
exception
wand.exceptions.
XServerError
¶ Bases:
wand.exceptions.BaseError
An X resource is unavailable.
-
exception
wand.exceptions.
XServerFatalError
¶ Bases:
wand.exceptions.BaseFatalError
An X resource is unavailable.
-
exception
wand.exceptions.
XServerWarning
¶ Bases:
wand.exceptions.BaseWarning
An X resource is unavailable.