---
title: resp.is_locally_generated
summary: null
url: >-
  https://www.fastly.com/documentation/reference/vcl/variables/client-response/resp-is-locally-generated
---

**Type:** BOOL  
**Access:** read-only

**Available in:** deliver, log

Whether request handling went through `vcl_error`.

Request handling will go through `vcl_error` and a response will be generated
locally when the VCL executes the `error` action or when Varnish encounters a
problem while handling the request, such as a communication failure with the
backend. This VCL variable allows you to distinguish locally generated error
responses from error responses received from upstream (from the origin or
from a [shield](https://www.fastly.com/documentation/guides/concepts/shielding) pop).

All synthetic responses are generated in `vcl_error`, not only error responses.
If you use `vcl_error` to generate synthetic responses in non-error cases,
you might need to check `resp.status` in combination with
`resp.is_locally_generated` to determine that a response is a locally
generated error response.
