Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
inaba46256yThen you should try Virustotals which gives you empty string when it doesn't like your input or your api key is wrong :v
-
ltlian21966yThis made me burst out laughing on the bus. My first api had a bunch of stuff like this.
I had a phase when I first learned error handling where I felt that if you could detect an error before it actually occurred and instead abort (or worse, "fix" it by parsing or making assumptions the user didn't ask for), then it was no longer an error. Good job, me. One potential error gone.
I had stuff like 404 on empty search results, 200 with json on error (remember to check the response.error prop!), and generally 204 on anything that "was allowed to be undefined".
I hope I atoned by the hours I spent being confused and misled by my own errors. -
rantspoon176yThere's also a place in Hell for people who return 503 while the service is getting up and in browser it shows valid page, that will automatically reload when service finishes booting (I'm looking at you Jenkins). This unfortunatelly breaks load balancer checks, if boot takes too long.
-
benj8836yI don't wanna go to hell!! Is just that is easier to write red.send("error...") than looking up what's the appropriate response code!
Related Rants
There's a special place in Hell for people who design APIs that returns 200 but then put error messages in the response body.
rant
api design
wk129
errors