mirror of
https://github.com/gin-gonic/gin.git
synced 2025-04-06 03:57:46 +08:00
29 lines
613 B
Go
29 lines
613 B
Go
package errorparser
|
|
|
|
type ParseError struct {
|
|
ParamName string
|
|
ErrorType ParseErrorType
|
|
InitialError error
|
|
}
|
|
|
|
func NewParseError(
|
|
paramName string,
|
|
errorType ParseErrorType,
|
|
initialError error,
|
|
) ParseError {
|
|
return ParseError{
|
|
ParamName: paramName,
|
|
ErrorType: errorType,
|
|
InitialError: initialError,
|
|
}
|
|
}
|
|
|
|
type ParseErrorType string
|
|
|
|
const (
|
|
ParseErrorTypeNone ParseErrorType = ""
|
|
ParseErrorTypeBadInput ParseErrorType = "bad_input"
|
|
ParseErrorTypeMismatch ParseErrorType = "type_mismatch"
|
|
ParseErrorTypeValidation ParseErrorType = "validation"
|
|
)
|