<p>A big thanks to Michael Rog (@rog) for the answer on Slack. You can create a catch-all error template with the name <code>error</code> (using whatever file ext works for you). That template also has access to a variable called <code>code</code> that tells you what kind of error it is. In my case, I'm using it to display <a href="https://http.cat/">HTTP Cats</a>.</p>

CC BY-SA 3.0
2016-03-27T21:04:58.233Z
(p.s. You can customize the location for your error templates by changing the `errorTemplatePrefix` setting in the [Craft General Config](https://craftcms.com/docs/config-settings).)
Michael Rog
CC BY-SA 3.0
2016-03-27T20:49:09.913Z
2016-03-27T20:49:09.913Z
Bryan Redeagle
<p>I want to have one template handle all of my error pages (instead of creating 404.html, 500.html, &amp;c.).</p>

<error-templates>
How do you create dynamic error pages?
# How do you create dynamic error pages?

(Asked by: username_0 on 2016-03-27)

I want to have one template handle all of my error pages (instead of creating 404.html, 500.html, &c.).

**Tags:** error-templates


---

## 1 answers

### Answer by username_0 on 2016-03-27. Score: 4

A big thanks to username_1 (@rog) for the answer on Slack. You can create a catch-all error template with the name `error` (using whatever file ext works for you). That template also has access to a variable called `code` that tells you what kind of error it is. In my case, I'm using it to display [HTTP Cats](https://http.cat/).

> **Comments:**
> **username_1**: (p.s. You can customize the location for your error templates by changing the `errorTemplatePrefix` setting in the [Craft General Config](https://craftcms.com/docs/config-settings).)  

---

