- Denier
- Params
- google.rpc.Status
- Overview
- Language mapping
- Other uses
Denier
The denier
adapter is designed to always return a denial to preconditionchecks. You can specify the exact error to return for these denials.
This adapter supports the checknothing template,the listentry template,and the quota template.
Params
Configuration format for the Denier adapter.
Field | Type | Description | Required |
---|---|---|---|
status | Status | The error to return when denying a request. | No |
validDuration | Duration | The duration for which the denial is valid. | No |
validUseCount | int32 | The number of times the denial may be used. | No |
google.rpc.Status
The Status
type defines a logical error model that is suitable fordifferent programming environments, including REST APIs and RPC APIs. It isused by gRPC. The error model is designed to be:
- Simple to use and understand for most users
- Flexible enough to meet unexpected needs
Overview
The Status
message contains three pieces of data: error code, errormessage, and error details. The error code should be an enum value ofgoogle.rpc.Code, but it may accept additional error codesif needed. The error message should be a developer-facing English messagethat helps developers understand and resolve the error. If a localizeduser-facing error message is needed, put the localized message in the errordetails or localize it in the client. The optional error details may containarbitrary information about the error. There is a predefined set of errordetail types in the package google.rpc
that can be used for common errorconditions.
Language mapping
The Status
message is the logical representation of the error model, but itis not necessarily the actual wire format. When the Status
message isexposed in different client libraries and different wire protocols, it can bemapped differently. For example, it will likely be mapped to some exceptionsin Java, but more likely mapped to some error codes in C.
Other uses
The error model and the Status
message can be used in a variety ofenvironments, either with or without APIs, to provide aconsistent developer experience across different environments.
Example uses of this error model include:
Partial errors. If a service needs to return partial errors to the client,it may embed the
Status
in the normal response to indicate the partialerrors.Workflow errors. A typical workflow has multiple steps. Each step mayhave a
Status
message for error reporting.Batch operations. If a client uses batch request and batch response, the
Status
message should be used directly inside batch response, one foreach error sub-response.Asynchronous operations. If an API call embeds asynchronous operationresults in its response, the status of those operations should berepresented directly using the
Status
message.Logging. If some API errors are stored in logs, the message
Status
couldbe used directly after any stripping needed for security/privacy reasons.
Field | Type | Description | Required |
---|---|---|---|
code | int32 | The status code, which should be an enum value ofgoogle.rpc.Code. | No |
message | string | A developer-facing error message, which should be in English. Anyuser-facing error message should be localized and sent in thegoogle.rpc.Status.details field, or localizedby the client. | No |
details | Any[] | A list of messages that carry the error details. There is a common set ofmessage types for APIs to use. | No |