diff options
author | INADA Naoki <methane@users.noreply.github.com> | 2016-02-14 17:08:13 +0900 |
---|---|---|
committer | INADA Naoki <methane@users.noreply.github.com> | 2016-02-14 17:08:13 +0900 |
commit | f895517995754ce9bb758a77ea3db9ac7e6262c9 (patch) | |
tree | 66c3c4472ac6530cb861cab553d045dc716fd082 /msgpack/exceptions.py | |
parent | 82b31215079bc47bd4d5a8f3c18d83ac73c8221b (diff) | |
parent | b2a8ce6cbdbef80d1a89d02fa483f56862cf1efa (diff) | |
download | msgpack-python-f895517995754ce9bb758a77ea3db9ac7e6262c9.tar.gz |
Merge pull request #172 from methane/palaviv-msgpack-exceptions
Organize Exceptions
Diffstat (limited to 'msgpack/exceptions.py')
-rw-r--r-- | msgpack/exceptions.py | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/msgpack/exceptions.py b/msgpack/exceptions.py index f7678f1..9766881 100644 --- a/msgpack/exceptions.py +++ b/msgpack/exceptions.py @@ -1,5 +1,5 @@ class UnpackException(Exception): - pass + """Deprecated. Use Exception instead to catch all exception during unpacking.""" class BufferFull(UnpackException): @@ -11,10 +11,10 @@ class OutOfData(UnpackException): class UnpackValueError(UnpackException, ValueError): - pass + """Deprecated. Use ValueError instead.""" -class ExtraData(ValueError): +class ExtraData(UnpackValueError): def __init__(self, unpacked, extra): self.unpacked = unpacked self.extra = extra @@ -22,8 +22,20 @@ class ExtraData(ValueError): def __str__(self): return "unpack(b) received extra data." + class PackException(Exception): - pass + """Deprecated. Use Exception instead to catch all exception during packing.""" + class PackValueError(PackException, ValueError): - pass + """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. + """ |