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

feat: add Exception handle #1619

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

a67793581
Copy link
Contributor

Purpose of the Pull Request:
This pull request introduces support for logging HTTPException errors in a structured and consistent manner. The goal is to improve error handling and logging for HTTP exceptions that occur within our application.

How to Test:
Trigger an HTTPException: Modify a route to intentionally raise an HTTPException.
Run the Application: Start the application using the standard development server.
Send a Request: Use a tool like curl or Postman to send a request that triggers the exception.
Verify Logs: Check the application logs to ensure that the HTTPException is logged with the correct status code, message, and any additional context.

To Validate the Changes:
Check Log Format: Ensure that the log entry for the HTTPException contains the status code, message, and relevant metadata.
Review Error Handling: Confirm that the application gracefully handles the exception and returns the appropriate response to the client.
Performance Impact: Monitor the application's performance before and after the change to ensure there is no significant impact.

Expected Outcomes:
Structured Logging: All HTTPException errors are logged with a consistent format, including the status code and message.
Enhanced Debugging: Developers can quickly identify and debug issues based on the detailed logs.
User Experience: Clients receive clear and informative error messages, enhancing the overall user experience.

Have You Tested This PR?
Yes, I have tested the latest commit on this PR. I verified the functionality by triggering various HTTPException scenarios and ensuring that the logs contain the expected information.

Related Issues or PRs:
#1618: This PR addresses the need for better logging of HTTP exceptions as discussed in this issue.

Is Your PR Over 500 Lines of Code?
No, this PR includes under 500 lines of code.

Additional Context:
The performance improvement was observed in our production environment after deploying these changes. The indexing strategy was carefully designed to optimize frequently used queries without impacting write performance. In the context of this PR, we have ensured that the logging enhancements do not introduce any significant overhead while still providing valuable insights into the application's behavior.

@a67793581 a67793581 changed the title Exception handle feat: add Exception handle Aug 6, 2024
@sarahwooders sarahwooders self-requested a review August 7, 2024 05:08
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.

1 participant