Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export InvalidInputErr #45

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions codes.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,18 +114,18 @@ func (e CodedError) Code() Code {
return e.GetCode
}

// invalidInputErr gives the code InvalidInputCode.
type invalidInputErr struct{ CodedError }
// InvalidInputErr gives the code InvalidInputCode.
type InvalidInputErr struct{ CodedError }

// NewInvalidInputErr creates an invalidInputErr from an err.
// NewInvalidInputErr creates an InvalidInputErr from an err.
// If the error is already a descendant of InvalidInputCode it will use that code.
// Otherwise it will use InvalidInputCode which gives HTTP 400.
func NewInvalidInputErr(err error) ErrorCode {
return invalidInputErr{NewCodedError(err, InvalidInputCode)}
func NewInvalidInputErr(err error) InvalidInputErr {
return InvalidInputErr{NewCodedError(err, InvalidInputCode)}
}

var _ ErrorCode = (*invalidInputErr)(nil) // assert implements interface
var _ unwrapError = (*invalidInputErr)(nil) // assert implements interface
var _ ErrorCode = (*InvalidInputErr)(nil) // assert implements interface
var _ unwrapError = (*InvalidInputErr)(nil) // assert implements interface

// BadReqeustErr is coded to InvalidInputCode
type BadRequestErr struct{ CodedError }
Expand Down
Loading