Skip to main content Skip to list of content
Service phase: Beta

This is a new service – give us your feedback to help improve it.

Content

Error pages

Provide users with clear and helpful error pages when something goes wrong.

Contents

  1. Page not found
  2. Restricted access
  3. Service issue
  4. Rate limited
Open this example in new tab

Provide the user with information about the error:

Error type
A very short description of the error in present tense such as "Page not found"
Error details (optional)
More details about why the error may have occured
Suggested next steps
Some possible next steps that the user can take to either access the content they want or report the issue

Test all links and buttons to make sure they work. Remember to do the hard work to make it simple.

Some of the main types of error page are:

A complete list of responses that are available for error pages can be found on MDN - HTTP response status codes.

Open this example in new tab

HTML

<h1 class="tna-heading-xl">Page not found</h1>
<p>If you typed the web address, check it is correct.</p>
<p>If you pasted the web address, check you copied the entire address.</p>
<p>If the web address is correct or you selected a link or button, <a href="https://www.nationalarchives.gov.uk/contact-us/">contact us</a> to let us help.</p>

Use a page not found error if someone is trying to view a page that does not exist. This happens if someone:

The server should also return a 404 response for this page.

Open this example in new tab

HTML

<h1 class="tna-heading-xl">Restricted</h1>
<p>You are not permitted to view this content.</p>
<p>If you typed the web address, check it is correct.</p>
<p>If you pasted the web address, check you copied the entire address.</p>
<p>If you believe you should be able to view this content, <a href="https://www.nationalarchives.gov.uk/contact-us/">contact us</a> to request access.</p>

Use a restricted access error if someone is trying to view a page or resource that they shouldn’t be allowed to. This can happen if:

The server should also return either a 401 (Unauthorized) or 403 (Forbidden) response for this page.

Open this example in new tab

HTML

<h1 class="tna-heading-xl">There is a problem with the service</h1>
<p>Try again in a few minutes.</p>
<p>If the web address is correct or you selected a link or button, <a href="https://www.nationalarchives.gov.uk/contact-us/">contact us</a> to let us help.</p>

Use a service issue error if someone is trying to view a page that the service is currently unable to render. This can happen if:

The server should also return a response code in the 5xx range.

Open this example in new tab

HTML

<h1 class="tna-heading-xl">Too many requests</h1>
<p>You have requested too many resources in a set timeframe.</p>
<p>Try again in a few minutes.</p>

Use a rate limited error if someone makes too many requests to a service.

This error will mainly be aimed at bots and tools that are used to scrape content from the site, often sending enough requests to slow down parts of our system.

Don’t give details on how many requests in a given timeframe will trigger the error or how long until they are able to make more requests.


Back to top