Base pyasn1 exception `PyAsn1Error` is the base exception class (based on :class:`Exception`) that represents all possible ASN.1 related errors. Parameters ---------- args: Opaque positional parameters Keyword Args ------------ kwargs: Opaque ke
| 7 | |
| 8 | |
| 9 | class PyAsn1Error(Exception): |
| 10 | """Base pyasn1 exception |
| 11 | |
| 12 | `PyAsn1Error` is the base exception class (based on |
| 13 | :class:`Exception`) that represents all possible ASN.1 related |
| 14 | errors. |
| 15 | |
| 16 | Parameters |
| 17 | ---------- |
| 18 | args: |
| 19 | Opaque positional parameters |
| 20 | |
| 21 | Keyword Args |
| 22 | ------------ |
| 23 | kwargs: |
| 24 | Opaque keyword parameters |
| 25 | |
| 26 | """ |
| 27 | def __init__(self, *args, **kwargs): |
| 28 | self._args = args |
| 29 | self._kwargs = kwargs |
| 30 | |
| 31 | @property |
| 32 | def context(self): |
| 33 | """Return exception context |
| 34 | |
| 35 | When exception object is created, the caller can supply some opaque |
| 36 | context for the upper layers to better understand the cause of the |
| 37 | exception. |
| 38 | |
| 39 | Returns |
| 40 | ------- |
| 41 | : :py:class:`dict` |
| 42 | Dict holding context specific data |
| 43 | """ |
| 44 | return self._kwargs.get('context', {}) |
| 45 | |
| 46 | |
| 47 | class ValueConstraintError(PyAsn1Error): |