Re:D for the Win
by Gracana on Friday August 22, 2014 @11:04AM
(#8212399)
I don't do anything quite so tedious in my Go-based webserver projects. For functions that can return errors that I don't have a way to recover from (db calls, for example), I use a simple rapper function that automatically logs errors and panics. That doesn't seem to me like much of a source of difficulty or complexity.
[ Parent
| on HN ]
Re:D for the Win
by jacques_chester on Saturday August 23, 2014 @10:49AM
(#8215926)
Web apps are apps, they have different expectations and provide different levels of robustness guarantees. As I said, Go's design decisions are motivated by a different problem domain.
That being said, I've followed a similar pattern in writing Go web apps. I passed errors upwards from their originating site to the HTTP handler functions, because that was where the error handling was possible with the best context.