Skip to content

Commit

Permalink
Merge pull request #1 from CybercentreCanada/err_handling
Browse files Browse the repository at this point in the history
Catch all for errors
  • Loading branch information
cccs-kevin authored Sep 24, 2020
2 parents 89182d5 + 431e981 commit 4e240c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions metadefender.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,8 @@ def scan_file(self, filename: str):

self.nodes[self.current_node]['timeout_count'] = 0
self.nodes[self.current_node]['timeout'] = 0
elif r.status_code == requests.codes.bad:
raise RecoverableError(f"Unable to scan file due to {r.json()['err']}")
else:
raise Exception(f"Unable to scan file due to {r.json()['err']}")
return r.json()

def parse_results(self, response: Dict[str, Any]):
Expand Down

0 comments on commit 4e240c4

Please sign in to comment.