diff --git a/cerrors/http/transport.go b/cerrors/http/transport.go index 8fc632b..52a8668 100644 --- a/cerrors/http/transport.go +++ b/cerrors/http/transport.go @@ -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 diff --git a/cerrors/http/transport_test.go b/cerrors/http/transport_test.go index 392da5f..c419c57 100644 --- a/cerrors/http/transport_test.go +++ b/cerrors/http/transport_test.go @@ -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{