# !usr/bin/env python# -*- coding: utf-8 -*-## Licensed under a 3-clause BSD license.## @Author: Brian Cherinka# @Date: 2017-12-05 12:01:21# @Last modified by: Brian Cherinka# @Last Modified time: 2017-12-05 12:19:32from__future__importprint_function,division,absolute_import
[docs]classBrainError(Exception):"""A custom core Brain exception"""def__init__(self,message=None):message='There has been an error' \
ifnotmessageelsemessagesuper(BrainError,self).__init__(message)
[docs]classBrainNotImplemented(BrainError):"""A custom exception for not yet implemented features."""def__init__(self,message=None):message='This feature is not implemented yet.' \
ifnotmessageelsemessagesuper(BrainNotImplemented,self).__init__(message)
[docs]classBrainAPIError(BrainError):"""A custom exception for API errors"""def__init__(self,message=None):ifnotmessage:message='Error with Http Response from Brain API'else:message='Http response error from Brain API. {0}'.format(message)super(BrainAPIError,self).__init__(message)
[docs]classBrainApiAuthError(BrainAPIError):"""A custom exception for API authentication errors"""pass
[docs]classBrainMissingDependency(BrainError):"""A custom exception for missing dependencies."""pass
[docs]classBrainWarning(Warning):"""Base warning for Brain."""