Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/msgpack/exceptions.py: 94%
17 statements
« prev ^ index » next coverage.py v7.5.0, created at 2024-05-02 06:19 +0000
« prev ^ index » next coverage.py v7.5.0, created at 2024-05-02 06:19 +0000
1class UnpackException(Exception):
2 """Base class for some exceptions raised while unpacking.
4 NOTE: unpack may raise exception other than subclass of
5 UnpackException. If you want to catch all error, catch
6 Exception instead.
7 """
10class BufferFull(UnpackException):
11 pass
14class OutOfData(UnpackException):
15 pass
18class FormatError(ValueError, UnpackException):
19 """Invalid msgpack format"""
22class StackError(ValueError, UnpackException):
23 """Too nested"""
26# Deprecated. Use ValueError instead
27UnpackValueError = ValueError
30class ExtraData(UnpackValueError):
31 """ExtraData is raised when there is trailing data.
33 This exception is raised while only one-shot (not streaming)
34 unpack.
35 """
37 def __init__(self, unpacked, extra):
38 self.unpacked = unpacked
39 self.extra = extra
41 def __str__(self):
42 return "unpack(b) received extra data."
45# Deprecated. Use Exception instead to catch all exception during packing.
46PackException = Exception
47PackValueError = ValueError
48PackOverflowError = OverflowError