defaultCustomErrorResponsePolicy property

CustomErrorResponsePolicy? defaultCustomErrorResponsePolicy
getter/setter pair

defaultCustomErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendServiceorBackendBucket responds with an error.

This policy takes effect at the load balancer level and applies only when no policy has been defined for the error code at lower levels like PathMatcher, RouteRule and PathRule within this UrlMap.

For example, consider a UrlMap with the following configuration:

 - defaultCustomErrorResponsePolicy containing policies for
 responding to 5xx and 4xx errors
 - A PathMatcher configured for *.example.com has
 defaultCustomErrorResponsePolicy for 4xx.

If a request for http://www.example.com/ encounters a404, the policy inpathMatcher.defaultCustomErrorResponsePolicy will be enforced. When the request for http://www.example.com/ encounters a502, the policy inUrlMap.defaultCustomErrorResponsePolicy will be enforced. When a request that does not match any host in *.example.com such as http://www.myotherexample.com/, encounters a404, UrlMap.defaultCustomErrorResponsePolicy takes effect.

When used in conjunction withdefaultRouteAction.retryPolicy, retries take precedence. Only once all retries are exhausted, thedefaultCustomErrorResponsePolicy is applied. While attempting a retry, if load balancer is successful in reaching the service, the defaultCustomErrorResponsePolicy is ignored and the response from the service is returned to the client.

defaultCustomErrorResponsePolicy is supported only for global external Application Load Balancers.

Implementation

CustomErrorResponsePolicy? defaultCustomErrorResponsePolicy;