Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error message when upsert records #27

Merged
merged 2 commits into from
Dec 9, 2024
Merged

Improve error message when upsert records #27

merged 2 commits into from
Dec 9, 2024

Conversation

butkeraites-hotglue
Copy link
Contributor

No description provided.

response_content = response.text if hasattr(response, 'text') else str(response)

error_message = f"Error: {e}, Response: {response_content}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's good 🙌 maybe we can also add the status code and the sink where it happened, also either here or in validate_response it would be good to log the request body and url just so it's easier for us to debug if an error happens.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

…esponse details

- Updated log_error_message method to accept sink_name and log more detailed error messages, including response status code, URL, and request body.
- Adjusted calls to log_error_message across ContactsSink, CampaignSink, and FallbackSink to pass the sink name for better context in error logs.
@hsyyid hsyyid merged commit 73b6551 into main Dec 9, 2024
0 of 5 checks passed
@hsyyid hsyyid deleted the feature/hgi-6844 branch December 9, 2024 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants