Retry authentication for auth keys up to five times by default

This commit is contained in:
Lonami Exo
2017-09-17 19:14:36 +02:00
parent e7a936222f
commit 78155a21bd
3 changed files with 42 additions and 23 deletions

View File

@@ -46,9 +46,15 @@ class BrokenAuthKeyError(Exception):
)
class CdnFileTamperedError(Exception):
class SecurityError(Exception):
def __init__(self, *args):
if not args:
args = ['A security check failed.']
super().__init__(self, *args)
class CdnFileTamperedError(SecurityError):
def __init__(self):
super().__init__(
self,
'The CDN file has been altered and its download cancelled.'
)