mirror of
https://github.com/msgpack/msgpack-python.git
synced 2025-12-08 06:09:49 +00:00
Split exceptions.
This commit is contained in:
parent
dd5c76b955
commit
219d47503c
4 changed files with 45 additions and 13 deletions
23
msgpack/exceptions.py
Normal file
23
msgpack/exceptions.py
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
class UnpackException(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class BufferFull(UnpackException):
|
||||
pass
|
||||
|
||||
|
||||
class OutOfData(UnpackException):
|
||||
pass
|
||||
|
||||
|
||||
class UnpackValueError(UnpackException, ValueError):
|
||||
pass
|
||||
|
||||
|
||||
class ExtraData(ValueError):
|
||||
def __init__(self, unpacked, extra):
|
||||
self.unpacked = unpacked
|
||||
self.extra = extra
|
||||
|
||||
def __str__(self):
|
||||
return "unpack(b) recieved extra data."
|
||||
Loading…
Add table
Add a link
Reference in a new issue