From 219d47503ca982996b03f4396fdd2929c9905356 Mon Sep 17 00:00:00 2001 From: INADA Naoki Date: Mon, 10 Dec 2012 00:31:19 +0900 Subject: Split exceptions. --- msgpack/exceptions.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 msgpack/exceptions.py (limited to 'msgpack/exceptions.py') 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." -- cgit v1.2.1