From c929e4c4355c6260472bf871befca02bc167a2ed Mon Sep 17 00:00:00 2001 From: "enus.linden" Date: Tue, 10 Feb 2009 00:43:19 +0000 Subject: [PATCH] adding new struct.error exception handler --- pyogp/lib/base/exc.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pyogp/lib/base/exc.py b/pyogp/lib/base/exc.py index 8c09668..3f8e8ce 100644 --- a/pyogp/lib/base/exc.py +++ b/pyogp/lib/base/exc.py @@ -209,6 +209,19 @@ class MessageDeserializationError(MessageSystemError): def __str__(self): return "Error serializing '%s' due to reason: '%s'" % (self.label, self.reason) +class DataUnpackingError(MessageSystemError): + """ problem deserializing packet data + + stores the label and reason in ``label`` and ``reason`` attributes + """ + + def __init__(self, data='', reason=''): + self.data = data + self.reason = reason + + def __str__(self): + return "Error serializing '%s' due to reason: '%s'" % (self.data, self.reason) + ########################## ### high level exceptions ##########################