diff options
author | INADA Naoki <songofacandy@gmail.com> | 2012-12-10 03:13:21 -0800 |
---|---|---|
committer | INADA Naoki <songofacandy@gmail.com> | 2012-12-10 03:13:21 -0800 |
commit | 0d63c67e98a208f148794cea03f1b49a445bd538 (patch) | |
tree | 2d4e78eec383de10bea5bcc68b8229669daa9680 /msgpack/exceptions.py | |
parent | dd5c76b9552e371503535ce10a0314151e62fa28 (diff) | |
parent | 1c0fe10a2fd5a32cf3f558683695220f3718a4b8 (diff) | |
download | msgpack-python-0d63c67e98a208f148794cea03f1b49a445bd538.tar.gz |
Merge pull request #37 from msgpack/exceptions
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." |