hashexception

This commit is contained in:
Bui 2020-03-17 01:27:54 +00:00
parent fe90a35625
commit 873bd1a73e

2
app.py
View File

@ -53,7 +53,7 @@ def generate_hash(id, form):
for url in urls:
resp = requests.get(url)
if resp.status_code != 200:
raise Exception('Invalid response from %s (status code %s)' % (resp.url, resp.status_code))
raise HashException('Invalid response from %s (status code %s)' % (resp.url, resp.status_code))
md5.update(resp.content)
return base64.b64encode(md5.digest())[:-2].decode('utf-8')