Commit 873bd1a7 authored by Bui's avatar Bui

hashexception

parent fe90a356
...@@ -53,7 +53,7 @@ def generate_hash(id, form): ...@@ -53,7 +53,7 @@ def generate_hash(id, form):
for url in urls: for url in urls:
resp = requests.get(url) resp = requests.get(url)
if resp.status_code != 200: 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) md5.update(resp.content)
return base64.b64encode(md5.digest())[:-2].decode('utf-8') return base64.b64encode(md5.digest())[:-2].decode('utf-8')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment