diff options
author | INADA Naoki <inada-n@klab.com> | 2012-12-10 00:31:19 +0900 |
---|---|---|
committer | INADA Naoki <inada-n@klab.com> | 2012-12-10 00:31:19 +0900 |
commit | 219d47503ca982996b03f4396fdd2929c9905356 (patch) | |
tree | d9e5cdc89a68e504775c010dec7476da70abebbe /msgpack/exceptions.py | |
parent | dd5c76b9552e371503535ce10a0314151e62fa28 (diff) | |
download | msgpack-python-219d47503ca982996b03f4396fdd2929c9905356.tar.gz |
Split exceptions.
Diffstat (limited to 'msgpack/exceptions.py')
-rw-r--r-- | msgpack/exceptions.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/msgpack/exceptions.py b/msgpack/exceptions.py new file mode 100644 index 0000000..0a75430 --- /dev/null +++ b/msgpack/exceptions.py @@ -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." |