Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify custom exception class #1412

Merged
merged 1 commit into from Sep 19, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 3 additions & 8 deletions chatterbot/adapters.py
Expand Up @@ -28,16 +28,11 @@ class AdapterMethodNotImplementedError(NotImplementedError):
method in a subclass.
"""

def __init__(self, message=None):
def __init__(self, message='This method must be overridden in a subclass method.'):
"""
Set the message for the esception.
Set the message for the exception.
"""
if not message:
message = 'This method must be overridden in a subclass method.'
self.message = message

def __str__(self):
return self.message
super().__init__(message)

class InvalidAdapterTypeException(Exception):
"""
Expand Down