Split exceptions.

This commit is contained in:
INADA Naoki 2012-12-10 00:31:19 +09:00
parent dd5c76b955
commit 219d47503c
4 changed files with 45 additions and 13 deletions

23
msgpack/exceptions.py Normal file
View 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."