From 75a1bf157648c5b5c155ac81e4950bff5315c0ae Mon Sep 17 00:00:00 2001 From: Hank Shen Date: Wed, 6 Dec 2023 11:51:36 +0800 Subject: update --- errors.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'errors.go') diff --git a/errors.go b/errors.go index 9d9833d..8760316 100644 --- a/errors.go +++ b/errors.go @@ -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) } -- cgit v1.2.3