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

fix: perhaps MISSING #1779

Merged
merged 1 commit into from
Jan 20, 2022
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
18 changes: 9 additions & 9 deletions errors/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package errors

// BadRequest new BadRequest error that is mapped to a 400 response.
func BadRequest(reason, message string) *Error {
return Newf(400, reason, message)
return New(400, reason, message)
}

// IsBadRequest determines if err is an error which indicates a BadRequest error.
Expand All @@ -14,7 +14,7 @@ func IsBadRequest(err error) bool {

// Unauthorized new Unauthorized error that is mapped to a 401 response.
func Unauthorized(reason, message string) *Error {
return Newf(401, reason, message)
return New(401, reason, message)
}

// IsUnauthorized determines if err is an error which indicates a Unauthorized error.
Expand All @@ -25,7 +25,7 @@ func IsUnauthorized(err error) bool {

// Forbidden new Forbidden error that is mapped to a 403 response.
func Forbidden(reason, message string) *Error {
return Newf(403, reason, message)
return New(403, reason, message)
}

// IsForbidden determines if err is an error which indicates a Forbidden error.
Expand All @@ -36,7 +36,7 @@ func IsForbidden(err error) bool {

// NotFound new NotFound error that is mapped to a 404 response.
func NotFound(reason, message string) *Error {
return Newf(404, reason, message)
return New(404, reason, message)
}

// IsNotFound determines if err is an error which indicates an NotFound error.
Expand All @@ -47,7 +47,7 @@ func IsNotFound(err error) bool {

// Conflict new Conflict error that is mapped to a 409 response.
func Conflict(reason, message string) *Error {
return Newf(409, reason, message)
return New(409, reason, message)
}

// IsConflict determines if err is an error which indicates a Conflict error.
Expand All @@ -58,7 +58,7 @@ func IsConflict(err error) bool {

// InternalServer new InternalServer error that is mapped to a 500 response.
func InternalServer(reason, message string) *Error {
return Newf(500, reason, message)
return New(500, reason, message)
}

// IsInternalServer determines if err is an error which indicates an Internal error.
Expand All @@ -69,7 +69,7 @@ func IsInternalServer(err error) bool {

// ServiceUnavailable new ServiceUnavailable error that is mapped to a HTTP 503 response.
func ServiceUnavailable(reason, message string) *Error {
return Newf(503, reason, message)
return New(503, reason, message)
}

// IsServiceUnavailable determines if err is an error which indicates a Unavailable error.
Expand All @@ -80,7 +80,7 @@ func IsServiceUnavailable(err error) bool {

// GatewayTimeout new GatewayTimeout error that is mapped to a HTTP 504 response.
func GatewayTimeout(reason, message string) *Error {
return Newf(504, reason, message)
return New(504, reason, message)
}

// IsGatewayTimeout determines if err is an error which indicates a GatewayTimeout error.
Expand All @@ -91,7 +91,7 @@ func IsGatewayTimeout(err error) bool {

// ClientClosed new ClientClosed error that is mapped to a HTTP 499 response.
func ClientClosed(reason, message string) *Error {
return Newf(499, reason, message)
return New(499, reason, message)
}

// IsClientClosed determines if err is an error which indicates a IsClientClosed error.
Expand Down