oncall-engine/engine/apps/mattermost/exceptions.py

22 lines
598 B
Python
Raw Permalink Normal View History

class MattermostAPITokenInvalid(Exception):
pass
class MattermostAPIException(Exception):
def __init__(self, status, url, msg="", method="GET"):
self.url = url
self.status = status
self.method = method
self.msg = msg
def __str__(self) -> str:
return f"MattermostAPIException: status={self.status} url={self.url} method={self.method} error={self.msg}"
class MattermostEventTokenInvalid(Exception):
def __init__(self, msg=""):
self.msg = msg
def __str__(self):
return f"MattermostEventTokenInvalid message={self.msg}"