diff options
-rw-r--r-- | securecookie.go | 4 |
1 files 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)) |