News for hackers. Stuff that matters.
Re:Write Better Error Messages by alisonatwork on Wednesday October 19, 2022 @11:17AM (#33263474)
A useful thing here is not just to include a unique error code for the type of error (usually numeric), but also to generate some kind of short Base32 or similar hash and print that right next to the error message while logging it to your normal back end. Then whether people send you a screen shot, copy/paste, whatever, you can easily search the logs to find the exact event that occurred.
Re:Write Better Error Messages by mceachen on Wednesday October 19, 2022 @12:41PM (#33264689)
Better still: add a unique prefix to the error code, so it's googlable.

The Typescript team does this with compilation errors, like `TS12345: frobulating types cannot be transmuted`.

Re:Write Better Error Messages by rmetzler on Wednesday October 19, 2022 @02:13PM (#33265863)
Yes, that type of thing is pretty useful for linters. These error codes act as identifiers if you need to google them and whenever you need to configure the linter the way you like it or for one-off exceptions.