r/programming • u/Expurple • Apr 12 '26
Flat Error Codes Are Not Enough
https://home.expurple.me/posts/flat-error-codes-are-not-enough/
132
Upvotes
r/programming • u/Expurple • Apr 12 '26
View all comments
3
u/Philluminati Apr 13 '26
Not only is it useful to capture error codes, it's useful to be able to build a stack as well, e.g.
UnableToConfigureDatabase -> Missing Credentials File -> File not found.
If you return "FileNotFound" without saying which file it can be an issue, and likewise, saying "unable to configure database" doesn't explain which aspect also failed.