PyAsn1Error

class pyasn1.error.PyAsn1Error(*args, **kwargs)

Base pyasn1 exception

PyAsn1Error is the base exception class (based on Exception) that represents all possible ASN.1 related errors.

Parameters

args – Opaque positional parameters

Keyword Arguments

kwargs – Opaque keyword parameters

property context

Return exception context

When exception object is created, the caller can supply some opaque context for the upper layers to better understand the cause of the exception.

Returns

dict – Dict holding context specific data

ValueConstraintError

class pyasn1.error.ValueConstraintError(*args, **kwargs)

ASN.1 type constraints violation exception

The ValueConstraintError exception indicates an ASN.1 value constraint violation.

It might happen on value object instantiation (for scalar types) or on serialization (for constructed types).

SubstrateUnderrunError

class pyasn1.error.SubstrateUnderrunError(*args, **kwargs)

ASN.1 data structure deserialization error

The SubstrateUnderrunError exception indicates insufficient serialised data on input of a de-serialization codec.

PyAsn1UnicodeError

class pyasn1.error.PyAsn1UnicodeError(message, unicode_error=None)

Unicode text processing error

The PyAsn1UnicodeError exception is a base class for errors relating to unicode text de/serialization.

Apart from inheriting from PyAsn1Error, it also inherits from UnicodeError to help the caller catching unicode-related errors.

PyAsn1UnicodeDecodeError

class pyasn1.error.PyAsn1UnicodeDecodeError(message, unicode_error=None)

Unicode text decoding error

The PyAsn1UnicodeDecodeError exception represents a failure to deserialize unicode text.

Apart from inheriting from PyAsn1UnicodeError, it also inherits from UnicodeDecodeError to help the caller catching unicode-related errors.

PyAsn1UnicodeEncodeError

class pyasn1.error.PyAsn1UnicodeEncodeError(message, unicode_error=None)

Unicode text encoding error

The PyAsn1UnicodeEncodeError exception represents a failure to serialize unicode text.

Apart from inheriting from PyAsn1UnicodeError, it also inherits from UnicodeEncodeError to help the caller catching unicode-related errors.