Commit eb74aecb authored by juga's avatar juga
Browse files

scanner: catch exception when stopping scanner

parent c6078004
......@@ -39,9 +39,11 @@ def timed_recv_from_server(session, dest, byte_range):
try:
requests_utils.get(
session, dest.url, headers=headers, verify=dest.verify)
except requests.exceptions.ConnectionError as e:
return False, e
except requests.exceptions.ReadTimeout as e:
# NewConnectionError will be raised when shutting down.
except (requests.exceptions.ConnectionError,
requests.exceptions.ReadTimeout,
requests.exceptions.NewConnectionError) as e:
log.debug(e)
return False, e
end_time = time.time()
return True, end_time - start_time
......
Supports Markdown
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