pkg / errors

Simple error handling primitives

Home Page:https://godoc.org/github.com/pkg/errors

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PROPOSAL: Add Message() method to withMessage{}

decibel opened this issue · comments

When dealing with multiple layers of errors wrapped by WithMessage(), there's no good way to obtain each individual message.

Sorry, this is by design. The errors package gives you a way to add textual annotations to your error that can be Fprinted, and a way to remove all of that guff and recover the original error.

I suggest following the way os.PathError works, a named type that can be asserted, which contains a named field with subsequent errors.