DEV Community

Discussion on: Write Errors That Don't Make Me Think

Collapse
_bkern profile image
Barry

I can't agree more. People fail to design errors and exceptions way too much. It is not as exciting as perhaps 'other' development but just as important. Another area I feel people don't spend enough time on is their domain modeling but that doesn't exactly fit this scenario. However, take this advice to heart and the more thought and design you put into these areas the better your code or app or library will be! If I could add one it would be to make errors unique. I hate when you encounter a library/codebase/app that returns the same 'error' for every scenario. Of course everything could have a valid reason (hopefully not that you just don't care about your error design) but the more you can guide the user or consumer the better.

Collapse
swyx profile image
swyx Author

thanks Barry! absolutely, that is a sign of lazy developers. of course, even better if the error has an error code. all in service of "Error SEO" :)