Skip to content

Commit

Permalink
runtime: return 503 vs 403 with ResourceExhausted.
Browse files Browse the repository at this point in the history
  • Loading branch information
hexfusion authored and achew22 committed Mar 7, 2018
1 parent d96e013 commit 38e17a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion runtime/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func HTTPStatusFromCode(code codes.Code) int {
case codes.Unauthenticated:
return http.StatusUnauthorized
case codes.ResourceExhausted:
return http.StatusForbidden
return http.StatusServiceUnavailable
case codes.FailedPrecondition:
return http.StatusPreconditionFailed
case codes.Aborted:
Expand Down

1 comment on commit 38e17a9

@eleniums
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why this shouldn't be http.StatusRequestEntityTooLarge (https://httpstatuses.com/413)? gRPC seems to be using codes.ResourceExhausted when the request is too big.

Please sign in to comment.