{"repo":"Southclaws/fault","free":true,"listed":false,"github":"https://github.com/Southclaws/fault","clone":"git clone https://github.com/Southclaws/fault.git","description":"Go errors but structured and composable. Fault provides an extensible yet ergonomic mechanism for wrapping errors.","language":"Go","stars":311,"topics":["errors","golang","go","go-context","structured-logging","structured-errors","go-errors"],"license":"MIT","category":"dev-tools","readme_excerpt":"Used in production at Storyden - an open source forum+wiki written in Go! Fault provides an extensible yet ergonomic mechanism for wrapping errors. It implements this as a kind of middleware style pattern of simple functions called decorators : func(error) error . A decorator simply wraps an error within another error, much like many libraries do. What this facilitates is a simple, minimal and (most important) composable collection of error handling utilities designed to help you diagnose problems in your application logic without the need for overly verbose stack traces. This is achieved by annotating errors with structured metadata instead of just gluing strings of text together. This approach plays nicely with structured logging tools as well as the existing Go errors ecosystem. - Usage - Wrapping errors - Handling errors - Utilities - fmsg - fctx - ftag - Appendix Usage You can gradually adopt Fault into your codebase as it plays nicely with the existing Go error management ecosystem. Wrapping errors Wrapping errors as you ascend the call stack is essential to providing your team with adequate context when something goes wrong. Simply wrap your errors as you would with any library: What this gives you is basic stack traces. The philosophy behind stack traces provided by Fault is that you only care about relevant code locations. You do not need runtime/proc.go in your stack traces unless you're actually working on the Go compiler or some crazy low level tooling. A fault st","default_branch":null,"files":null,"tree":[],"storefront":"/r/Southclaws","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Southclaws/fault/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}