Skip to content

Commit

Permalink
feat(cerrors): StatusUnprocessableEntityに対応
Browse files Browse the repository at this point in the history
  • Loading branch information
KamikazeZirou committed Apr 4, 2022
1 parent 698c39d commit 881b384
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cerrors/http/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func ToCommonErrorCode(statusCode int) cerrors.ErrorCode {
return cerrors.NotFoundErr
case http.StatusNotImplemented:
return cerrors.UnimplementedErr
case http.StatusBadRequest:
case http.StatusBadRequest, http.StatusUnprocessableEntity:
return cerrors.ParameterErr
case http.StatusServiceUnavailable:
return cerrors.UnavailableErr
Expand Down
7 changes: 7 additions & 0 deletions cerrors/http/transport_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ func TestToCommonErrorCode(t *testing.T) {
},
want: cerrors.ParameterErr,
},
{
name: "StatusUnprocessableEntity",
args: args{
http.StatusUnprocessableEntity,
},
want: cerrors.ParameterErr,
},
{
name: "StatusServiceUnavailable",
args: args{
Expand Down

0 comments on commit 881b384

Please sign in to comment.