Skip to content

Return correct HTTP status code on gRPC error  #1

@veniversum

Description

@veniversum

Currently, a 500 status code is returned no matter the cause of the error. The API should respond with an appropriate HTTP status code for the error.

An example mapping of gRPC errors -> HTTP status:
https://github.com/GoogleCloudPlatform/google-cloud-node/blob/525fb0fc1a7ad064b75050bfc03455508cf0dba5/packages/common/src/grpc-service.js#L50-L135

An example of gRPC response handler:
https://github.com/GoogleCloudPlatform/google-cloud-node/blob/525fb0fc1a7ad064b75050bfc03455508cf0dba5/packages/common/src/grpc-service.js#L564

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions