Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
What's with all these shitty APIs giving off wrong error codes?
devTea242566dWhen shitheads tried to reinvent the wheel
Konsole31096d@devTea @kescherRant You guys wouldn't believe what was causing that.
Some shithead was catching all exceptions and rethrowing them as a RuntimeError.
Then the handler would think it's a runtime error and throw 500 instead of original error
The shithead had done something like this in the controller:
throw new RuntimeException(e);
I can't stop laughing and crying at the same time 🤣😭
C0D4410906dWell.. it's slightly better then a 200 response with a 400/500 error.
Why people can't think to handle errors, beats the hell out of me.
@Konsole was this my code by any chance? :) I do that. Users do not need to know what exactly has failed in the back office. They need to know that the server fucked up, that's all. Giving away TMI opens all sorts of security risks.
Handle the error? Sure. I do whereever I can. But if I do not know what the error might be or if it doesn't really matter what the error was at some point [assuming that was a mission-critical part of the code] and I cannot possibly recover from it [or don't really want to... Why would I spawn 100 api call retries while my user is waiting for a response? It might take hours], I might just dump the error to the logs for the RCA and tell the user "sorry, there's something off at our side, we couldn't serve your request", rather than giving away my app/infra details. Giving away TMI would tell attackers their attack vectors are working. It might give out clues for other atrack vectors, like sw we're using [ora errors, gson/jackson, etc], unstable/weak parts of the system, etc.
Parzi38386d*sets up server to send back 418s for all 4xx errors*
exactly: your back end is shit
Your Job Suck?
Take a quick quiz from Triplebyte to skip the job search hassles and jump to final interviews at hot tech firms
Get a Better Job