Skip to content

Commit

Permalink
feat: Use failed to load resource msg for 404 response
Browse files Browse the repository at this point in the history
  • Loading branch information
kovalch committed Apr 12, 2024
1 parent 826df10 commit af7dce6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ckan_pkg_checker/utils/request_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ def _check_with_user_agent(test_url, http_method, user_agent):
)
# ignore 405 Method Not Allowed errors
if 405 != e.response.status_code:
return str(e) # Return the error message
if 404 == e.response.status_code:
return "Failed to load resource: the server responded with a status of 404 (Not Found)"
else:
return str(e) # Return the error message
except (ValueError, requests.exceptions.RequestException) as e:
log.debug(
"REQUEST EXCEPTION OCCURRED for URL %s (%s): %r"
Expand Down

0 comments on commit af7dce6

Please sign in to comment.