fix(web): handle TypeCastError when building form validation messages (#40212)

Fixes https://github.com/go-gitea/gitea/issues/40210

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Alan Hsuandwxiaoguang authored and GitHub committed 2026-11-06 23:27:06 +00:00
1 parent ede9ec3e10
commit df4544a58b
3 files changed
+28 -9

No files matched your search

+4 -1
View File
@@ -28,10 +28,13 @@ import (
)
const (
// TODO: need to refactor the binding package, let the rules provide error message directly.
// Don't use the fragile Classification and useless&incorrect Message field in the future.
errContentType = "ContentTypeError"
errDeserialization = "DeserializationError"
errTypeCast = "TypeCastError"
errRule = "RuleError"
ErrTypeCast = errTypeCast
ErrRequired = "RequiredError"
ErrAlphaDashDot = "AlphaDashDotError"