From 145cbe5fe2165394056b32a5290c5fe6e050ad63 Mon Sep 17 00:00:00 2001 From: Joscha Date: Mon, 23 May 2016 02:48:45 +0200 Subject: [PATCH] Add exceptions --- yaboli/__init__.py | 1 + yaboli/exceptions.py | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 yaboli/exceptions.py diff --git a/yaboli/__init__.py b/yaboli/__init__.py index 9502526..0443c38 100644 --- a/yaboli/__init__.py +++ b/yaboli/__init__.py @@ -1,5 +1,6 @@ from .callbacks import Callbacks from .connection import Connection +from .exceptions import * from .session import Session from .message import Message from .sessions import Sessions diff --git a/yaboli/exceptions.py b/yaboli/exceptions.py new file mode 100644 index 0000000..f48993d --- /dev/null +++ b/yaboli/exceptions.py @@ -0,0 +1,41 @@ +class YaboliException(Exception): + """ + Generic yaboli exception class. + """ + + pass + +class BotManagerException(YaboliException): + """ + Generic BotManager exception class. + """ + + pass + +class CreateBotException(BotManagerException): + """ + This exception will be raised when BotManager could not create a bot. + """ + + pass + +class BotNotFoundException(BotManagerException): + """ + This exception will be raised when BotManager could not find a bot. + """ + + pass + +class BotException(YaboliException): + """ + Generic Bot exception class. + """ + + pass + +class ParseMessageException(BotException): + """ + This exception will be raised when a failure parsing a message occurs. + """ + + pass