-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat(RequestHandler): add modelName
to handleAndLogRequestError
params
#22081
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(RequestHandler): add modelName
to handleAndLogRequestError
params
#22081
Conversation
@SevInf Your thoughts here would be very much appreciated! 😀 |
Thank you @AikoRamalho, overall looks good, left one small comment. |
modelName
to handleAndLogRequestError
params
Working on it! |
2140e3d
to
d619e4c
Compare
Hey @SevInf ! I created some tests for unique constraint validation errors. However, I haven't tested all possible error codes for PrismaClientKnownError. Let me know your thoughts on the matter, and please inform me if it's necessary to include any tests—I'll implement them here. Thanks for your cooperation! I'm loving contributing to the project! |
f11e9cc
to
804f774
Compare
Hey @janpio! Your thoughts here would be very much appreciated! thank you!!! |
804f774
to
00640de
Compare
00640de
to
9b5b64e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AikoRamalho looks good, thank you and congratulations on the first contribution.
Closes #20724
This PR enhances error handling in the codebase by including the modelName parameter in the error handling process. This modification ensures better contextual information is available when handling and logging errors during a request.
Changes
Added modelName to the parameters passed in the catch block of the try-catch statement.
Updated the HandleErrorParams interface and modified the handleRequestError method to include the modelName parameter.
Motivation
When an error occurs during a request, having the modelName information at hand can significantly improve the debugging and error resolution process. This update provides more comprehensive details about the context in which an error occurred, enhancing the overall maintainability and troubleshooting capabilities of the code.