24 lines
502 B
Python
24 lines
502 B
Python
class MissingHeadersError(Exception):
|
|
def __init__(self, headers: list):
|
|
self.headers = ', '.join(headers)
|
|
self.message = f'Missing required headers for verificaton: {self.headers}'
|
|
super().init(self.message)
|
|
|
|
|
|
def __str__(self):
|
|
return self.message
|
|
|
|
|
|
class VerificationError(Exception):
|
|
def __init__(self, string=None):
|
|
self.message = f'Failed to verify hash'
|
|
|
|
if string:
|
|
self.message += ' for ' + string
|
|
|
|
super().__init__(self.message)
|
|
|
|
|
|
def __str__(self):
|
|
return self.message
|