Skip to content
Merged
Changes from 1 commit
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
8 changes: 8 additions & 0 deletions errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ func (e ErrorCode) ToHTTP() int {
return http.StatusUnauthorized
case UnprocessableEntity:
return http.StatusUnprocessableEntity
case UpstreamServerError:
return http.StatusBadGateway
case UpstreamClientError:
return http.StatusFailedDependency
default:
return http.StatusInternalServerError
}
Expand Down Expand Up @@ -308,6 +312,10 @@ const (
Unauthenticated ErrorCode = "unauthenticated"
// Cannot consume the entity in the given format
UnprocessableEntity ErrorCode = "unprocessable_entity"
// Upstream server error
UpstreamServerError ErrorCode = "upstream_server_error"
// Upstread client error
UpstreamClientError ErrorCode = "upstream_client_error"
)

type psrpcError struct {
Expand Down
Loading