| outline |
|
| title |
ERROR_CODE_POLICY Annotation |
| titleTemplate |
NpgsqlRest |
| description |
Associate error handling policies with PostgreSQL REST API endpoints. Map PostgreSQL errors to custom HTTP responses. |
| head |
meta |
| name |
content |
keywords |
npgsqlrest error policy, postgresql error handling, custom error responses, error code mapping |
|
|
meta |
| property |
content |
og:title |
NpgsqlRest ERROR_CODE_POLICY Annotation |
|
|
meta |
| property |
content |
og:description |
Associate error handling policies for custom PostgreSQL error responses. |
|
|
meta |
| property |
content |
og:type |
article |
|
|
|
::: info Also known as
error_code_policy, error_code (with or without @ prefix)
:::
Associate an error handling policy with the endpoint.
@error_code_policy <policy-name>
@error_code <policy-name>
comment on function risky_operation() is
'HTTP POST
@error_code_policy strict_errors';
comment on function api_endpoint() is
'HTTP GET
@error_code default_policy';
- References an error policy defined in the ErrorCodePolicies configuration
- Controls how PostgreSQL errors are mapped to HTTP status codes
- Defines error response format