From c8b3f5bfac649f948542b609cc99508b9a44e929 Mon Sep 17 00:00:00 2001 From: Nicolas Jouanin Date: Sun, 31 May 2015 21:36:45 +0200 Subject: [PATCH] Create new exception base hierarchy for MQTT errors --- hbmqtt/codecs/errors.py | 7 +++++-- hbmqtt/errors.py | 6 ++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/hbmqtt/codecs/errors.py b/hbmqtt/codecs/errors.py index 6655e7c..fa39ba6 100644 --- a/hbmqtt/codecs/errors.py +++ b/hbmqtt/codecs/errors.py @@ -1,8 +1,11 @@ # Copyright (c) 2015 Nicolas JOUANIN # # See the file license.txt for copying permission. - -class CodecException(BaseException): +from hbmqtt.errors import MQTTException +class CodecException(MQTTException): + """ + Exceptions thrown by encode/decode process + """ pass class NoDataException(CodecException): diff --git a/hbmqtt/errors.py b/hbmqtt/errors.py index 87e4a21..e8c0866 100644 --- a/hbmqtt/errors.py +++ b/hbmqtt/errors.py @@ -4,3 +4,9 @@ class BrokerException(BaseException): pass + +class MQTTException(BaseException): + """ + Base class for all errors refering to MQTT specifications + """ + pass \ No newline at end of file