Open sefadegirmenci opened 1 year ago
Did you try this with the HTML API? it feels like it does not work as intended (i.e. in HTML API) but I cannot be sure. I think the DRF's exception handler is more than capable.
It seems to be fixed with this exception handler:
Before:
Now:
Description
This pull request adds a custom exception handler to the Django project. The handler provides a consistent way of handling exceptions and gives better control over the handling process. If an exception is not handled, the handler will now return a 500 response code without any garbage-like error messages.
Related Issue
109
Motivation and Context
I did not observe 500 code as mentioned in the issue, however, it would be appropriate to have an exception handler. While we currently only raise Validation Errors in the codebase, it is possible that we will need to add custom errors in the future. Having a handler in place will allow us to customize the error messages and response codes for these errors.
Screenshots (if appropriate):