summaryrefslogtreecommitdiff
path: root/msgpack/exceptions.py
diff options
context:
space:
mode:
authorINADA Naoki <methane@users.noreply.github.com>2018-11-12 02:19:01 +0900
committerGitHub <noreply@github.com>2018-11-12 02:19:01 +0900
commit07f0beeabb71828377f481ff83746997b3babf23 (patch)
tree632502320e7016fbf1c605f34f5963cf287c119c /msgpack/exceptions.py
parent1bf62ba6f8f94ab8a7dd135e0039ee3b10e0e96c (diff)
downloadmsgpack-python-07f0beeabb71828377f481ff83746997b3babf23.tar.gz
Remove deprecated exception classes (#323)
Diffstat (limited to 'msgpack/exceptions.py')
-rw-r--r--msgpack/exceptions.py35
1 files changed, 16 insertions, 19 deletions
diff --git a/msgpack/exceptions.py b/msgpack/exceptions.py
index 9766881..5bee5b2 100644
--- a/msgpack/exceptions.py
+++ b/msgpack/exceptions.py
@@ -1,6 +1,10 @@
class UnpackException(Exception):
- """Deprecated. Use Exception instead to catch all exception during unpacking."""
+ """Base class for some exceptions raised while unpacking.
+ NOTE: unpack may raise exception other than subclass of
+ UnpackException. If you want to catch all error, catch
+ Exception instead.
+ """
class BufferFull(UnpackException):
pass
@@ -10,11 +14,16 @@ class OutOfData(UnpackException):
pass
-class UnpackValueError(UnpackException, ValueError):
- """Deprecated. Use ValueError instead."""
+# Deprecated. Use ValueError instead
+UnpackValueError = ValueError
class ExtraData(UnpackValueError):
+ """ExtraData is raised when there is trailing data.
+
+ This exception is raised while only one-shot (not streaming)
+ unpack.
+ """
def __init__(self, unpacked, extra):
self.unpacked = unpacked
self.extra = extra
@@ -23,19 +32,7 @@ class ExtraData(UnpackValueError):
return "unpack(b) received extra data."
-class PackException(Exception):
- """Deprecated. Use Exception instead to catch all exception during packing."""
-
-
-class PackValueError(PackException, ValueError):
- """PackValueError is raised when type of input data is supported but it's value is unsupported.
-
- Deprecated. Use ValueError instead.
- """
-
-
-class PackOverflowError(PackValueError, OverflowError):
- """PackOverflowError is raised when integer value is out of range of msgpack support [-2**31, 2**32).
-
- Deprecated. Use ValueError instead.
- """
+#Deprecated. Use Exception instead to catch all exception during packing.
+PackException = Exception
+PackValueError = ValueError
+PackOverflowError = OverflowError