There is value in a simple integer error code return from public C APIs, but it would be nice to have an easy way to get the full statement that forced the return, assert-style. INVALID_VALUE is not as helpful as it could be.
-
-
some structure where there is a string for every error code, a function that maps one to the other or whatever, for every little thing that can go wrong. (This of course leads to the thing that happened on both Unix and Windows where the same set of error codes gets mashed
-
together for everything, leading e.g. to everyone's favorite useless error EINVAL.) I think the improved ergonomics of just observing how bad this all went, and setting up the incentives so that better things happen naturally, are huge (and underestimated by everyone).
- Show replies
New conversation -
-
-
Jeezes, that's an insane code design. There should never be any foobazzes in the fiblinx.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Logging and error handling are related but independent concerns. Instead of a single integer representing an error code, perhaps it would be nice to partition 32-bits into sections where the leading bit says success/failure
-
Another say 8-bits to specify error type (like groups of exceptions in java: SQLException, IOException etc), another group of bits representing the specific error; a global library to dig into the fields as necessary, specifying the common errors plus leaving room for custom ones
End of conversation
New conversation -
-
-
I think this is very nice and useful. For dev builds, all the functions in my engine are logging and crashing in case of error, or logging a warning in case of a minor issue.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
A backend service perspective: this gets weird with wrapping & especially handling errors. Ideally the callers decide to log IFF the error is not recoverable and each error is logged only once. In practice this creates a ton of error handling (see golang.)
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Logging for debugging/presenting to the user is nice, but how do you handle that error if it involves more than just printing a message? E.g. if not enough foobazzes, do this, if the fiblinx is missing, do that.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.