Last active
May 4, 2020 13:49
-
-
Save AntonStoeckl/9950def38ea8e8bcefcf4ce753467ffb to your computer and use it in GitHub Desktop.
Example for my iDDD with Go blog article series at https://medium.com/@TonyBologni
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package shared | |
import "github.com/cockroachdb/errors" | |
var ( | |
ErrInputIsInvalid = errors.New("input is invalid") | |
ErrNotFound = errors.New("not found") | |
ErrDuplicate = errors.New("duplicate") | |
ErrDomainConstraintsViolation = errors.New("domain constraints violation") | |
ErrMaxRetriesExceeded = errors.New("max retries exceeded") | |
ErrConcurrencyConflict = errors.New("concurrency conflict") | |
ErrMarshalingFailed = errors.New("marshaling failed") | |
ErrUnmarshalingFailed = errors.New("unmarshaling failed") | |
ErrTechnical = errors.New("technical") | |
) | |
func MarkAndWrapError(original error, markAs error, wrapWith string) error { | |
return errors.Mark(errors.Wrap(original, wrapWith), markAs) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment