3.1. pci.exceptions module¶
This library contains the exceptions raised by PCI C++ code, translated to Python equivalent exceptions.
- class pci.exceptions.GetMessageImpl¶
Bases:
objectImplements the method
getMessage(). It exists to support code that that calledgetMessage()- getMessage()¶
Get the message for this object. This, method exists for backwards compatibility due to the elimination of the class pci.exceptions.UnicodeSafeException. If your code used this method to get an exception’s message, your code should continue to work correctly.
You should consider replacing all calls to getMessage() with str(e), which is the pythonic way to get an exception’s message.
This method simply does: return str(self)
- exception pci.exceptions.LicenseException(desc)¶
Bases:
GetMessageImpl,PermissionErrorRaised when a licensing error occurs.
Note that this class does not derive from
PCIException.
- exception pci.exceptions.PCIException(desc)¶
Bases:
Exception,GetMessageImplPCIExceptionis the base class for exceptions raised by PCI code.- getReason()¶
Get the reason for this exception. This strips everything before the last “Reason:” in the exception’s message. It can make for a nicer looking error message to the user.
- exception pci.exceptions.OSException(desc)¶
Bases:
PCIException,OSErrorRaise when a problem related to the operating system, that cannot be mapped to one of the
OSExceptionsubclasses, is encountered.Catching
OSErrorexceptions will handle this exception as well. The inverse is not true, catchingOSExceptionexceptions does not catchOSErrorexceptions.
- exception pci.exceptions.LibraryException(desc)¶
Bases:
PCIException,ImportErrorRaised when loading libraries fail.
Catching
ImportErrorexceptions will handle this exception as well. The inverse is not true, catchingLibraryExceptionexceptions does not catchImportErrorexceptions.
- exception pci.exceptions.MemoryAllocationException(desc)¶
Bases:
OSException,MemoryErrorRaised when memory allocation fails.
Catching
MemoryErrorexceptions will handle this exception as well. The inverse is not true, catchingMemoryAllocationExceptionexceptions does not catchMemoryErrorexceptions.
- exception pci.exceptions.OutOfDiskSpaceException(desc)¶
Bases:
OSExceptionRaised when there is not enough disk space.
Catching
OSErrorexceptions will handle this exception as well. The inverse is not true, catchingOutOfDiskSpaceExceptionexceptions does not catchOSErrorexceptions.
- exception pci.exceptions.ExternalException(desc)¶
Bases:
PCIException,RuntimeErrorRaised when an error from 3rd party libraries that can not be mapped to an existing exception is raised.
Catching
RuntimeErrorexceptions will handle this exception as well. The inverse is not true, catchingExternalExceptionexceptions does not catchRuntimeErrorexceptions.
- exception pci.exceptions.DataException(desc)¶
Bases:
PCIException,RuntimeErrorThe base class for all exceptions that are raised when data is being manipulated.
Catching
RuntimeErrorexceptions will handle this exception as well. The inverse is not true, catchingDataExceptionexceptions does not catchRuntimeErrorexceptions.
- exception pci.exceptions.DataTypeException(desc)¶
Bases:
DataException,TypeErrorRaised when data has an invalid type.
Catching
TypeErrorexceptions will handle this exception as well. The inverse is not true, catchingDataTypeExceptionexceptions does not catchTypeErrorexceptions.
- exception pci.exceptions.ParameterException(desc)¶
Bases:
DataException,ValueErrorRaised when a parameter is invalid.
Catching
TypeErrorexceptions will handle this exception as well. The inverse is not true, catchingDataTypeExceptionexceptions does not catchTypeErrorexceptions.
- exception pci.exceptions.FormatException(desc)¶
Bases:
DataException,ValueErrorRaised when data is formatted is incorrectly. For example, if a date is expected in dd/mm/yyyy format and received in yyyy/mm/dd format.
Catching
ValueErrorexceptions will handle this exception as well. The inverse is not true, catchingFormatExceptionexceptions does not catchValueErrorexceptions.
- exception pci.exceptions.OutOfBoundsException(desc)¶
Bases:
DataException,IndexErrorRaised when a variable is out of bounds.
Catching
IndexErrorexceptions will handle this exception as well. The inverse is not true, catchingOutOfBoundsExceptionexceptions does not catchIndexErrorexceptions.
- exception pci.exceptions.IOException(desc)¶
Bases:
PCIException,OSErrorRaised when an error related to I/O occurs that cannot be mapped in any of its subclasses.
Catching
OSErrorexceptions will handle this exception as well. The inverse is not true, catchingIOExceptionexceptions does not catchOSErrorexceptions.
- exception pci.exceptions.DeviceException(desc)¶
Bases:
IOException,OSErrorRaised when a hardware device is not found or not functioning properly.
Catching
OSErrorexceptions will handle this exception as well. The inverse is not true, catchingDeviceExceptionexceptions does not catchOSErrorexceptions.
- exception pci.exceptions.FileException(desc)¶
Bases:
IOException,OSErrorRaised when there is a file related error that doesn’t match any other subclass of
FileException.Catching
OSErrorexceptions will handle this exception as well. The inverse is not true, catchingFileExceptionexceptions does not catchOSErrorexceptions.
- exception pci.exceptions.FileAccessException(desc)¶
Bases:
FileException,PermissionErrorRaised when a file cannot be accessed.
Catching
PermissionErrorexceptions will handle this exception as well. The inverse is not true, catchingFileAccessExceptionexceptions does not catchPermissionErrorexceptions.
- exception pci.exceptions.FileFormatException(desc)¶
Bases:
FileException,OSErrorRaised when a file has an invalid format.
Catching
OSErrorexceptions will handle this exception as well. The inverse is not true, catchingFileFormatExceptionexceptions does not catchOSErrorexceptions.
- exception pci.exceptions.FileAlreadyExistsException(desc)¶
Bases:
FileException,FileExistsErrorRaised when a file exists.
Catching
FileExistsErrorexceptions will handle this exception as well. The inverse is not true, catchingFileAlreadyExistsExceptionexceptions does not catchFileExistsErrorexceptions.
- exception pci.exceptions.FileNotFoundException(desc)¶
Bases:
FileException,FileNotFoundErrorRaised when a file is not found.
Catching
FileNotFoundErrorexceptions will handle this exception as well. The inverse is not true, catchingFileNotFoundExceptionexceptions does not catchFileNotFoundErrorexceptions.
- exception pci.exceptions.FileCorruptException(desc)¶
Bases:
FileException,TypeErrorRaised when the file has the expected type but is corrupt.
Catching
TypeErrorexceptions will handle this exception as well. The inverse is not true, catchingFileCorruptExceptionexceptions does not catchTypeErrorexceptions.
- exception pci.exceptions.ParserException(desc)¶
Bases:
FileException,TypeErrorRaised when data cannot be parsed.
Catching
TypeErrorexceptions will handle this exception as well. The inverse is not true, catchingParserExceptionexceptions does not catchTypeErrorexceptions.
- exception pci.exceptions.NetworkException(desc)¶
Bases:
IOException,ConnectionErrorRaised when a network resource is not available.
Catching
ConnectionErrorexceptions will handle this exception as well. The inverse is not true, catchingNetworkExceptionexceptions does not catchConnectionErrorexceptions.
- exception pci.exceptions.TimeOutException(desc)¶
Bases:
NetworkException,TimeoutErrorRaised when network time out occurs.
Catching
TimeoutErrorexceptions will handle this exception as well. The inverse is not true, catchingTimeOutExceptionexceptions does not catchTimeoutErrorexceptions.
- exception pci.exceptions.TransformationException(desc)¶
Bases:
PCIException,ValueErrorRaised when an error occurs during data processing.
Catching
ValueErrorexceptions will handle this exception as well. The inverse is not true, catchingTransformationExceptionexceptions does not catchValueErrorexceptions.
- exception pci.exceptions.MathException(desc)¶
Bases:
TransformationException,ArithmeticErrorRaised when a mathematical error occurs.
Catching
ArithmeticErrorexceptions will handle this exception as well. The inverse is not true, catchingMathExceptionexceptions does not catchArithmeticErrorexceptions.
- exception pci.exceptions.ArithmeticException(desc)¶
Bases:
MathExceptionRaised when a error occurs with basic arithmetic operations.
Catching
ArithmeticErrorexceptions will handle this exception as well. The inverse is not true, catchingArithmeticExceptionexceptions does not catchArithmeticErrorexceptions.
- exception pci.exceptions.DemoModeException(desc)¶
Bases:
PCIException,PermissionErrorRaised when an error related to demo mode occured.
Catching
PermissionErrorexceptions will handle this exception as well. The inverse is not true, catchingDemoModeExceptionexceptions does not catchPermissionErrorexceptions.
- exception pci.exceptions.UnsupportedException(desc)¶
Bases:
PCIException,NotImplementedErrorRaised when something is unsupported.
Catching
NotImplementedErrorexceptions will handle this exception as well. The inverse is not true, catchingUnsupportedExceptionexceptions does not catchNotImplementedErrorexceptions.