-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
From Go 1.13:
return fmt.Errorf("unique error message: %w, err)From third-party pkg/errors package:
import (
// other imports here
"github.com/pkg/errors"
)
return errors.Wrap(err, "unique error message")Paraphrased explanation (I had a hard time keeping up and don't have enough time to properly replay/annotate):
You add your unique message, then you extend the actual error. Then when something goes wrong you can look at your unique message and it will tell you the "where", and the original message is the "why".