Hacker News new | past | comments | ask | show | jobs | submit login

Apologies, yes it was an attempt at humor. I was hoping for more of a discussion on the two approaches though if your still game.



Sure.

My scenario is a web service, that calls other web services.

It throws an error and then has to return something meaningful to the callee, which is usually both a message that tells the developer calling the web service how to fix it (if it's something that they can fix) as well as the relevant response code.

The advantage from assigning the code at the earliest point the error is detected is that one avoids any later text parsing of the error message to figure out the right code to return. It also allows general switching on the error code range to see whether you really need to throw the error or whether there is some other branch of logic that could be done instead.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: