Skip to content

Commit

Permalink
Output full path in error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ericboucher committed Jul 2, 2022
1 parent d0c9423 commit f098a22
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion singer_sdk/streams/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
TypeVar,
Union,
)
from urllib.parse import urlparse

import backoff
import requests
Expand Down Expand Up @@ -186,14 +187,15 @@ def response_error_message(self, response: requests.Response) -> str:
Returns:
str: The error message
"""
full_path = urlparse(response.url).path
if 400 <= response.status_code < 500:
error_type = "Client"
else:
error_type = "Server"

return (
f"{response.status_code} {error_type} Error: "
f"{response.reason} for path: {self.path}"
f"{response.reason} for path: {full_path}"
)

def request_decorator(self, func: Callable) -> Callable:
Expand Down

0 comments on commit f098a22

Please sign in to comment.