Skip to content

Commit 982c262

Browse files
Add UnprocessableEntity
1 parent 3915e00 commit 982c262

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

errors.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ func (e ErrorCode) ToHTTP() int {
8484
return http.StatusServiceUnavailable
8585
case Unauthenticated:
8686
return http.StatusUnauthorized
87+
case UnprocessableEntity:
88+
return http.StatusUnprocessableEntity
8789
default:
8890
return http.StatusInternalServerError
8991
}
@@ -303,6 +305,8 @@ const (
303305
DataLoss ErrorCode = "data_loss"
304306
// Similar to PermissionDenied, used when the caller is unidentified
305307
Unauthenticated ErrorCode = "unauthenticated"
308+
// Cannot consume the entity in the given format
309+
UnprocessableEntity ErrorCode = "unprocessable_entity"
306310
)
307311

308312
type psrpcError struct {

0 commit comments

Comments
 (0)