Error handling¶
Protocol¶
EnPowerX APIs report errors using standard gRPC status codes.
Additional error details are exposed using the gRPC Richer Error Model. The client libraries automatically map and expose these errors as exceptions/errors/etc.
EnPowerX APIs report errors using standard HTTP status codes.
Additional error details are exposed as JSON messages in the response like this:
{
"message": "invalid argument",
"details": [
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"field_violations": [
{
"field": "some_field",
"description": "Something is wrong with this value."
}
]
}
]
}
Common errors¶
The following errors can occur for any API call, even if the documentation does not explicitly list them:
HTTP status | gRPC status | Cause |
---|---|---|
401 | UNAUTHENTICATED | The request was made without the required authentication. |
403 | PERMISSION_DENIED | The current user is not authorized to perform the requested action. |
404 | NOT_FOUND | The specified tenant or resource was not found. |
409 | CONFLICT | The specified resource already exists, or a concurrency conflict, such as read-modify-write conflict, occurred. |
429 | RESOURCE_EXHAUSTED | Either out of resource quota or reaching rate limiting. |
500 | INTERNAL | The service is experiencing technical problems. |
501 | UNIMPLEMENTED | API method not implemented by the service. |
503 | UNAVAILABLE | The service is temporarily unavailable. |
Custom errors¶
Some APIs may also return custom error types. These still map to standard gRPC/HTTP status codes but carry additional information/details and are mapped to separate exception/error types by the client libraries.