Skip to content
Myr

Adds IsType() helper

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Manu Mtz-Almeida · committed by Manu Mtz-Almeida · parent 00b279c · Browse files · 1 file+4 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−0 removed

  • other:+4 added−0 removed

1 file+4 added−0 removed

modified:errors.go+4 added
74 unmodified lines
75func (msg *Error) Error() string {76 return msg.Err.Error()77}7879func (msg *Error) IsType(flags ErrorType) bool {80 return (msg.Type & flags) > 081}8283// Returns a readonly copy filterd the byte.84// ie ByType(gin.ErrorTypePublic) returns a slice of errors with type=ErrorTypePublic85func (a errorMsgs) ByType(typ ErrorType) errorMsgs {86 if len(a) == 0 {
72 unmodified lines