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 for failed callback #6247

Merged
merged 2 commits into from
Jun 16, 2023

Conversation

vowelparrot
Copy link
Contributor

@vowelparrot vowelparrot commented Jun 15, 2023

Include the handler class name in the warning

image

@vowelparrot vowelparrot requested a review from agola11 June 15, 2023 19:05
except Exception as e:
if handler.raise_error:
raise e
logger.warning(f"Error in {event_name} callback: {e}")
logger.warning(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just thinking. Maybe moving warning before if handler.raise_error: adds helpful information for debugging? Maybe raise e would provide enough debugging info. I'm not sure.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that's a good point, especially if it's running on a separate thread. I'll make the change

Copy link
Collaborator

@leo-gan leo-gan left a comment

Choose a reason for hiding this comment

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

LGTM, with a comment.

@vercel
Copy link

vercel bot commented Jun 16, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchain ❌ Failed (Inspect) Jun 16, 2023 2:07am

@vercel vercel bot temporarily deployed to Preview June 16, 2023 02:07 Inactive
@vowelparrot vowelparrot merged commit bc9b8c8 into master Jun 16, 2023
@vowelparrot vowelparrot deleted the vwp/better_callback_errors branch June 16, 2023 02:18
This was referenced Jun 25, 2023
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.

2 participants