Closed yangvz closed 8 years ago
I don't really follow. I like the extra information about what happened (module, programmatic codes, etc.), but I don't understand what the code is supposed to be doing (what's 23505?), what "err.stand" is, or why any of this isn't orthogonal to wrapping errors? The point of wrapping is for accretive error messages: a request may have failed because of an error to a backend service, which failed because of a problem talking to a database, which failed because some resource limit was exceeded, and so on. The point is to preserve all of that information for debugging.
Closing this, but feel free to reopen with clarification.
Wrapping errors feels wrong. How about this:
And the request handler renders appropriately using first err.stand then err.code. Both values can be overwritten. All you do is provide almost all common error standards like http.STATUS_CODES does, say pg.STATUS_CODES etc.