Skip to content

Commit cf1f3bc

Browse files
authored
[cdn] Adding examples of template token variables (#1386)
### Description Add `::vercel:REQUEST_ID::` and `::vercel:ERROR_CODE::` template tokens to custom error page examples. These tokens are replaced by Vercel with actual values when serving error pages, helping users reference specific requests when contacting support. ### Type of Change - [ ] New Example - [X] Example updates (Bug fixes, new features, etc.) - [ ] Other (changes to the codebase, but not to examples) ### New Example Checklist - [ ] 🛫 `npm run new-example` was used to create the example - [ ] 📚 The template wasn't used but I carefuly read the [Adding a new example](https://github.com/vercel/examples#adding-a-new-example) steps and implemented them in the example - [ ] 📱 Is it responsive? Are mobile and tablets considered?
1 parent 23ea7ca commit cf1f3bc

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

cdn/custom-error-pages-app-dir/app/500/page.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ export default function ServerError() {
66
<p className="mt-2 text-sm text-gray-500">
77
Something went wrong on our end. Please try again later.
88
</p>
9+
<p className="mt-2 text-sm text-gray-500">
10+
Request ID: ::vercel:REQUEST_ID::
11+
</p>
12+
<p className="mt-2 text-sm text-gray-500">
13+
Error: ::vercel:ERROR_CODE::
14+
</p>
915
<a href="/" className="mt-6 text-blue-600 hover:underline">
1016
Go back home
1117
</a>

cdn/custom-error-pages-app-dir/app/504/page.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ export default function GatewayTimeout() {
66
<p className="mt-2 text-sm text-gray-500">
77
The server took too long to respond. Please try again later.
88
</p>
9+
<p className="mt-2 text-sm text-gray-500">
10+
Request ID: ::vercel:REQUEST_ID::
11+
</p>
12+
<p className="mt-2 text-sm text-gray-500">
13+
Error: ::vercel:ERROR_CODE::
14+
</p>
915
<a href="/" className="mt-6 text-blue-600 hover:underline">
1016
Go back home
1117
</a>

cdn/custom-error-pages-public-dir/public/500.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
<h1>500</h1>
5151
<p class="description">Internal Server Error</p>
5252
<p class="hint">Something went wrong on our end. Please try again later.</p>
53+
<p class="hint">Request ID: ::vercel:REQUEST_ID::</p>
54+
<p class="hint">Error: ::vercel:ERROR_CODE::</p>
5355
<a href="/">Go back home</a>
5456
</div>
5557
</body>

cdn/custom-error-pages-public-dir/public/504.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
<h1>504</h1>
5151
<p class="description">Gateway Timeout</p>
5252
<p class="hint">The server took too long to respond. Please try again later.</p>
53+
<p class="hint">Request ID: ::vercel:REQUEST_ID::</p>
54+
<p class="hint">Error: ::vercel:ERROR_CODE::</p>
5355
<a href="/">Go back home</a>
5456
</div>
5557
</body>

0 commit comments

Comments
 (0)