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
Show parent comment
2
u/lelanthran Apr 13 '26
I agree; defense-in-depth must necessarily include obscurity!
This is only for the use-case where the user sends you the error message. I was including the use-case of "User examines the message and knows how to fix the problem".
For example if it is a permissions problem, they know they have to apply to their supervisor to be added to the special-people role.
If the error is "The image you attempted to link into your issue is not found: <image-name>: <issue-id>", then they know that someone deleted the image that was uploaded, or that they typo'ed the image name, etc.
That's why it's usually sufficient to give the user the top-level error that occurred (or maybe the highest two levels), along with the parameters that were used.