diff options
Diffstat (limited to 'errors.go')
-rw-r--r-- | errors.go | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -2,6 +2,18 @@ package securecookie import "errors" +func NewUsageError(err error) *cookieError { + return &cookieError{cause: err, typ: usageError} +} + +func NewInternalError(err error) *cookieError { + return &cookieError{cause: err, typ: internalError} +} + +func NewDecodeError(err error) *cookieError { + return &cookieError{cause: err, typ: decodeError} +} + func IsValueTooLong(err error) bool { return errors.Is(err, errEncodedValueTooLong) || errors.Is(err, errValueToDecodeTooLong) } |