How to fix backend error system hindering debugging? #1150
Replies: 2 comments 6 replies
-
The error system as implemented is for API clients to have a consistent error experience. I do think it serves that goal well, but keep in mind that implementation is currently incomplete. We've implemented the framework for returning errors, but haven't put a lot of work into defining individual errors. The idea is that backend developers will opportunistically define new, specific, errors when they find them useful. Eventually, code 4999 (which is
I think it would be ideal if we could use a setting/environment variable that would not catch exceptions and return the stack trace when it was on. We could use Django's We would need to remember to write tests for API errors to make sure they're working appropriately since we wouldn't see them as often when developing. |
Beta Was this translation helpful? Give feedback.
-
I have felt the pain too when debugging certain exceptions. There is certainly a lot to be done with exception handling, it is very easy to go down the rabbit hole and spending time perfecting it would take a lot of time from other important issues because there are a lot of questions that need to be answered For example,
Initially, I used |
Beta Was this translation helpful? Give feedback.
-
The problem is that when an exception is caught by our error system, it loses information that would be useful when debugging it. Information like the stack trace. Usually what I do to find out where the exception is being raised is insert breakpoints in the code that catches a regular exception and converts it into our custom exception. Something like:
If I'm not sure where the exception is being converted, that's harder. For example for a 500 server response with the following JSON body, the way to troubleshoot it is not clear at all:
There's ways to debug all these cases, but they are all tedious.
My questions to us:
Beta Was this translation helpful? Give feedback.
All reactions