---
title: Evaluation reasons and error codes
description: Flagship evaluation reason values and error codes returned by binding details methods and the OpenFeature SDK.
image: https://edgetunnel-b2h.pages.dev/dev-products-preview.png
---

> Documentation Index  
> Fetch the complete documentation index at: https://edgetunnel-b2h.pages.dev/flagship/llms.txt  
> Use this file to discover all available pages before exploring further. 

[Skip to content](#%5Ftop) 

# Evaluation reasons and error codes

When you evaluate a flag using the binding's `*Details` methods or the OpenFeature SDK, the response includes a `reason` field that explains why a particular value was returned. If an error occurs, the response includes an `errorCode` field.

## Evaluation reasons

| Reason           | Description                                                                                                                      |
| ---------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| TARGETING\_MATCH | A targeting rule's conditions matched the evaluation context, and the rule's variant was returned.                               |
| SPLIT            | A targeting rule with a percentage rollout matched. The user fell within the rollout percentage and received the rule's variant. |
| DEFAULT          | No targeting rule matched the evaluation context. The flag's default variant was returned.                                       |
| DISABLED         | The flag is disabled. The default variant was returned regardless of targeting rules.                                            |
| CACHED           | The SDK returned a cached evaluation result.                                                                                     |
| ERROR            | Evaluation failed and the default value was returned.                                                                            |

## Error codes

When an evaluation error occurs, the method returns the default value you provided. The `*Details` methods include additional metadata about the error.

| Error code       | Description                                                                                                                                                         |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| TYPE\_MISMATCH   | The flag's variant type does not match the requested type. For example, calling getBooleanValue on a flag whose variant is a string. The default value is returned. |
| FLAG\_NOT\_FOUND | The specified flag key does not exist in the app. The default value is returned.                                                                                    |
| INVALID\_CONTEXT | The evaluation context contains unsupported values, such as objects or arrays in HTTP evaluation. The default value is returned.                                    |
| PARSE\_ERROR     | The SDK received an invalid evaluation response. The default value is returned.                                                                                     |
| GENERAL          | An unexpected error occurred during evaluation, such as a timeout or network failure. The default value is returned.                                                |

## Example

The following example inspects evaluation details returned by `getBooleanDetails`:

* [  JavaScript ](#tab-panel-9292)
* [  TypeScript ](#tab-panel-9293)

**JavaScript**

```js
const details = await env.FLAGS.getBooleanDetails("my-feature", false, {
  userId: "user-42",
});


switch (details.reason) {
  case "TARGETING_MATCH":
    console.log(`Matched targeting rule, variant: ${details.variant}`);
    break;
  case "SPLIT":
    console.log(`Included in rollout, variant: ${details.variant}`);
    break;
  case "DEFAULT":
    console.log("No rule matched, using default variant");
    break;
  case "DISABLED":
    console.log("Flag is disabled");
    break;
}


if (details.errorCode) {
  console.error(`Evaluation error: ${details.errorCode}`);
}
```

**TypeScript**

```ts
const details = await env.FLAGS.getBooleanDetails("my-feature", false, {
  userId: "user-42",
});


switch (details.reason) {
  case "TARGETING_MATCH":
    console.log(`Matched targeting rule, variant: ${details.variant}`);
    break;
  case "SPLIT":
    console.log(`Included in rollout, variant: ${details.variant}`);
    break;
  case "DEFAULT":
    console.log("No rule matched, using default variant");
    break;
  case "DISABLED":
    console.log("Flag is disabled");
    break;
}


if (details.errorCode) {
  console.error(`Evaluation error: ${details.errorCode}`);
}
```

```json
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://edgetunnel-b2h.pages.dev/flagship/reference/evaluation-reasons/#page","headline":"Evaluation reasons and error codes · Cloudflare Flagship docs","description":"Flagship evaluation reason values and error codes returned by binding details methods and the OpenFeature SDK.","url":"https://edgetunnel-b2h.pages.dev/flagship/reference/evaluation-reasons/","inLanguage":"en","image":"https://edgetunnel-b2h.pages.dev/dev-products-preview.png","dateModified":"2026-06-24","publisher":{"@type":"Organization","name":"Cloudflare","url":"https://www.cloudflare.com/"},"isPartOf":{"@type":"WebSite","@id":"https://edgetunnel-b2h.pages.dev/#website","name":"Cloudflare Docs","url":"https://edgetunnel-b2h.pages.dev/"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"item":{"@id":"/directory/","name":"Directory"}},{"@type":"ListItem","position":2,"item":{"@id":"/flagship/","name":"Flagship"}},{"@type":"ListItem","position":3,"item":{"@id":"/flagship/reference/","name":"Reference"}},{"@type":"ListItem","position":4,"item":{"@id":"/flagship/reference/evaluation-reasons/","name":"Evaluation reasons and error codes"}}]}
```
