d3506f6a2e
This is a first implementation that needs more elaborate error msg.
22 lines
640 B
Python
22 lines
640 B
Python
# -*- coding: utf-8 -*-
|
|
import sys
|
|
import config
|
|
|
|
class RedfishException(Exception):
|
|
"""Base class for redfish exceptions"""
|
|
def __init__(self, message=None, **kwargs):
|
|
self.kwargs = kwargs
|
|
self.message = message
|
|
|
|
|
|
class AuthenticationFailureException(RedfishException):
|
|
def __init__(self, message=None, **kwargs):
|
|
super(AuthenticationFailureException, self).__init__(message=None, **kwargs)
|
|
config.logger.error(message)
|
|
# TODO
|
|
# Give a bit more details about the failure (check login etc...)
|
|
sys.exit(1)
|
|
|
|
class LogoutFailureException(RedfishException):
|
|
pass
|