Hacker News new | ask | show | jobs
by NateDad 4401 days ago
There are a lot of error handling libraries out there. On Juju, we're working on one right now. This is the preliminary version: https://github.com/juju/errgo

Basically you just call a function every time you would return an error, and it automatically records the file and line number and lets you add on some context to the message, plus it gives you the option to mask the type of the error (to hide implementation details from your callers).

I wouldn't use errgo right now, it's still under heavy development, but it's similar to a lot of other error handling libraries out there.