Error responses (3)·续
This error was generated by Cloudflare on behalf of the website owner.
---
## Test structured error responses
Fetch the structured JSON response for a 522 error:
```bash
curl --silent --compressed --header "Accept: application/json" \
--user-agent "TestAgent/1.0" --header "Accept-Encoding: gzip, deflate" \
"https://example.com/cdn-cgi/error/522" | jq .
Fetch the structured Markdown response:
curl --silent --compressed --header "Accept: text/markdown" \
--user-agent "TestAgent/1.0" --header "Accept-Encoding: gzip, deflate" \
"https://example.com/cdn-cgi/error/522"
Check for the Retry-After header on a retryable error:
curl --silent --compressed --dump-header - --output /dev/null \
--header "Accept: application/json" --user-agent "TestAgent/1.0" \
--header "Accept-Encoding: gzip, deflate" \
"https://example.com/cdn-cgi/error/521" | grep -i retry-after
Response fields
Both JSON and Markdown responses contain the same set of fields. JSON responses return them as a flat object; Markdown responses place them in YAML frontmatter followed by prose sections. The field definitions below apply to both formats.
JSON responses follow RFC 9457 (Problem Details for HTTP APIs) ↗︎. Any HTTP client that understands Problem Details can parse the five standard members (type, title, status, detail, instance) without Cloudflare-specific code.
RFC 9457 standard members
| Field | Type | Description |
|---|---|---|
type |
string | URI pointing to Cloudflare documentation for this error code. |
title |
string | Short summary, for example, "Error 522: Connection timed out". |
status |
integer | HTTP status code of the response. |
detail |
string | Plain-text explanation of what went wrong and which party is responsible. |
instance |
string | Ray ID identifying this specific error occurrence. |
Cloudflare extension members
| Field | Type | Description |
|---|---|---|
error_code |
integer | Cloudflare error code (for example, 522, 1015). |
error_name |
string | Machine-readable name in snake_case (for example, connection_timeout, rate_limited). Stable — suitable for programmatic matching. |
error_category |
string | Fault classification. Refer to Error categories. Stable — suitable for programmatic matching. |
ray_id |
string | Same value as instance. Included for compatibility with existing Cloudflare tooling. |
timestamp |
string | ISO 8601 timestamp of when the error was generated. |
zone |
string | The requested hostname. |
cloudflare_error |
boolean | Always true. Confirms this error was generated by Cloudflare, not the origin. |
retryable |
boolean | Whether the error is transient and the request can be retried. |
retry_after |
integer or null | Seconds to wait before retrying. Present only when retryable is true. Matches the Retry-After HTTP header value. |
owner_action_required |
boolean | Whether the site operator needs to take action to resolve the error. |
what_you_should_do |
string | Actionable guidance for the client: what to do next, whether to retry, and who can fix the problem. |
footer |
string | Attribution line. |
Markdown-specific structure
Markdown responses place these fields in YAML frontmatter (between --- delimiters), followed by three prose sections:
# Error {code}: {description}— heading with the error code and short description.## What Happened— corresponds to thedetailfield.## What You Should Do— corresponds to thewhat_you_should_dofield.
The frontmatter omits the RFC 9457 standard members (type, title, instance) and the footer field since these are either redundant with the prose or not applicable to the Markdown format.
Error categories
The error_category field classifies the fault so that clients can route retry and escalation behavior without parsing the prose fields.
5xx error categories
| Category | Codes | Meaning | Retry? |
|---|---|---|---|
origin |
502, 504, 520-524 | The origin server is responsible. Transient infrastructure failure. | Yes. Back off using retry_after. |
cloudflare |
500 | Cloudflare encountered an internal error. The origin was not necessarily involved. | Yes. Short retry (30s). |
ssl |
525, 526 | The origin's TLS configuration is broken (handshake failure or invalid certificate). | No. Retrying will not help until the operator fixes the TLS configuration. |
1xxx error categories
| Category | Meaning | Example codes |
|---|---|---|
access_denied |
IP blocks, country blocks, firewall rules | 1005, 1006, 1007, 1008, 1010, 1012, 1106-1109 |
rate_limit |
Rate limiting | 1015, 1025, 1027, 1200 |
dns |
DNS resolution errors | 1001, 1016 |
config |
Zone or origin configuration errors | 1004, 1014, 1033, 1043, 1047, 1049 |
tls |
Client TLS errors (version, cipher, certificate) | 1017, 1028, 1029, 1044 |
legal |
Legal restrictions (DMCA, country blocks) | 1026, 1039 |
worker |
Worker script errors | 1042, 1100, 1101, 1102, 1103, 1104, 1105 |
rewrite |
URL rewrite rule errors | 1036, 1037 |
snippet |
Snippet configuration errors | 1201, 1202, 1203, 1204, 1205, 1206 |
unsupported |
Unsupported features or protocols | 1045 |
Retry-After header
Retryable error codes include a standard Retry-After ↗︎ HTTP response header. The header value in seconds matches the retry_after field in the response body.
5xx Retry-After values
| Code | retry_after (in seconds) |
|---|---|
| 500 | 30 |
| 502 | 60 |
| 504 | 120 |
| 520 | 60 |
| 521 | 120 |
| 522 | 120 |
| 523 | 120 |
| 524 | 120 |
| 525 | N/A (not retryable) |
| 526 | N/A (not retryable) |
Non-retryable codes (525, 526) do not include the Retry-After header.
1xxx Retry-After values
Six retryable 1xxx error codes emit Retry-After:
| Code | retry_after (in seconds) |
Error name |
|---|---|---|
| 1004 | 120 | DNS resolution error |
| 1015 | 30 | Rate limited |
| 1033 | 120 | Argo Tunnel error |
| 1038 | 60 | HTTP headers limit exceeded |
| 1200 | 60 | Cache connection limit |
| 1205 | 5 | Too many redirects |
All other 1xxx error codes are non-retryable and do not include the Retry-After header.
If a WAF rate limiting rule has already set a dynamic Retry-After value on the response, that value takes precedence over the default.
More resources
- Cloudflare 1xxx errors
- Cloudflare 5xx errors
- Custom Errors
- Connection limits
- Markdown for Agents (content conversion)
- RFC 9457 — Problem Details for HTTP APIs ↗︎
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/fundamentals/reference/error-responses/#page","headline":"Error responses","description":"How Cloudflare formats error responses, including structured JSON and Markdown for agents and API clients, and how they interact with Custom Errors.","url":"https://developers.cloudflare.com/fundamentals/reference/error-responses/","inLanguage":"en","image":"https://developers.cloudflare.com/fundamentals/reference/error-responses/og.png?v=8a1dcafa8d90bd4d","dateModified":"2026-05-05","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
description: Review definitions for terms used across Cloudflare products and documentation. title: Glossary image: https://developers.cloudflare.com/fundamentals/reference/glossary/og.png?v=4d4f27773770e470
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/fundamentals/llms.txt
Use this file to discover all available pages before exploring further.
Docs