Hacker News new | past | comments | ask | show | jobs | submit login

At least if there's an error code, I can search for that specific error code and see if anybody else has run into it. Seeing "Error 3bad617a" means that somebody else may have copy-pasted that same error message, and it might show up in search for "$PROGRAM_NAME 3bad617a". This is best if every ___location that can give an error has a unique code, but can be useful even if it is just parroting some low-level code.

In other cases, an error code may be a standard value, and indicate that something is wrong with the inputs I provided as a user. If I see "Error saving file: 13", I may guess that the "13" was returned by some system call and is the error code EACCES or "Permission denied". I could test this by saving the file in another directory. The specific error code is useful for knowing what to do next, as error code 28 would be ENOSPC or "No space left on device", and I'd instead check if I ran out of disk space. (It would have been better if the error number had been passed through strerror() before display, but having the numeric code is still better than nothing.)




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: