::: info Also known as
error_code_policy_name, 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
- Error Handling configuration - Configure error code policies
- Comment Annotations Guide - How annotations work
- Configuration Guide - How configuration works
- SECURITY_SENSITIVE - Hide error details
- Error Handling - Configure error code policies
