Skip to content

Commit

Permalink
refactor: log the url in err.log if API fails to respond with the data
Browse files Browse the repository at this point in the history
  • Loading branch information
arzkar committed Jul 16, 2024
1 parent 4203c7a commit d2c37e3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fichub_cli/utils/fichub.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ def get_fic_metadata(self, url: str, format_type: list):
# Error: 'epub_url'
# Reason: Unsupported URL
except (KeyError, UnboundLocalError) as e:
with open("err.log", "a") as file:
file.write(url.strip()+"\n")

if self.debug:
logger.error(f"Error: {str(e)} not found!")
logger.error(f"GET:Response: {str(self.response)}")
Expand Down

0 comments on commit d2c37e3

Please sign in to comment.