Skip to content

Commit

Permalink
refactor(scrapers.utils): add explicit error handling to save_response
Browse files Browse the repository at this point in the history
  • Loading branch information
grossir committed Dec 11, 2024
1 parent 7d27f92 commit 21f75a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cl/scrapers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ def save_response(site: AbstractSite) -> None:
# both tests for and parses JSON content
content = json.loads(response.content)
extension = "json"
except:
except (UnicodeDecodeError, json.decoder.JSONDecodeError):
content = response.content
extension = "html"

Expand Down

0 comments on commit 21f75a7

Please sign in to comment.