
Ask HN: Error codes vs. error messages - zotez
I&#x27;m developing a package in Go and I&#x27;ve attempted to put a custom error message for each and every error condition. However I am now starting to have a problem where a lot of error conditions have the same or similar error message. This is making it very difficult to trace down the code responsible for the error. My question is, what does HN think about using numeric error codes to help identify the source of the error or should I just work really hard on making error messages different each and every time? Any better solution?
======
Bino
I think you should have error codes ("enums") all the way and the a way to
translate these into error messages. That removes a lot of problems with
spelling, changing the error message and interoperability with outers using
your package.

