From 70411ec97c1d20b373d980e549d7027a20b6f834 Mon Sep 17 00:00:00 2001 From: Hank Shen Date: Mon, 9 Oct 2023 12:45:11 +0800 Subject: update --- securecookie.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/securecookie.go b/securecookie.go index ddd3a69..ab708a3 100644 --- a/securecookie.go +++ b/securecookie.go @@ -286,7 +286,7 @@ func (s *SecureCookie) Encode(name string, value interface{}) (string, error) { b = encode(b) // 5. Check length. if s.maxLength != 0 && len(b) > s.maxLength { - return "", fmt.Errorf("%s: %d", errEncodedValueTooLong, len(b)) + return "", fmt.Errorf("[%s] %s: %d", name, errEncodedValueTooLong, len(b)) } // Done. return string(b), nil @@ -310,7 +310,7 @@ func (s *SecureCookie) Decode(name, value string, dst interface{}, maxAges ...in } // 1. Check length. if s.maxLength != 0 && len(value) > s.maxLength { - return fmt.Errorf("%s: %d", errValueToDecodeTooLong, len(value)) + return fmt.Errorf("[%s] %s: %d", name, errValueToDecodeTooLong, len(value)) } // 2. Decode from base64. b, err := decode([]byte(value)) -- cgit v1.2.3