summaryrefslogtreecommitdiff
path: root/msgpack/exceptions.py
diff options
context:
space:
mode:
authorINADA Naoki <inada-n@klab.com>2012-12-10 00:31:19 +0900
committerINADA Naoki <inada-n@klab.com>2012-12-10 00:31:19 +0900
commit219d47503ca982996b03f4396fdd2929c9905356 (patch)
treed9e5cdc89a68e504775c010dec7476da70abebbe /msgpack/exceptions.py
parentdd5c76b9552e371503535ce10a0314151e62fa28 (diff)
downloadmsgpack-python-219d47503ca982996b03f4396fdd2929c9905356.tar.gz
Split exceptions.
Diffstat (limited to 'msgpack/exceptions.py')
-rw-r--r--msgpack/exceptions.py23
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."