3 ms·
I think the main value here is understanding at the broadest level whether the problem is internal to the problem (unforeseen logic error), with how I configure
by mikepurvis 5y ago
I think the main value here is understanding at the broadest level whether the problem is internal to the problem (unforeseen logic error), with how I configured the program (bad flags), or with the environment in which I ran the program (out of memory, disk, whatever).
Obviously a single integer is not going to be a rich error-reporting mechanism, but particularly in the context of something like a process manager or job runner, it could be helpful to know what kinds of errors might go away on a retry, for example.
- ttyprintk 5y agoI think history supports this, but I’m not sure I can cite a reference. Early Unix code I wrote followed the convention that codes 1-3 belong to system utilities, 4-9 are unreserved, and users pick 10-127. Some exotic use cases wrap some meaning into higher codes, but historically we only cared to detect whether the error comes from system binaries or within the application. I suppose programming on top of the application would mean using 20, but I still pick 10 by habit.