---
category: [Administration & Integrations, Platform and Product Extensions, Platform and Product Extensions/Integration, Administration & Integrations/Custom Integrations & Apps, Platform and Product Extensions/Workday Extend]
keyword: [Extend, Presentation Components, UI components]
nav: wcp_docs
parent_url: /wcp_docs/
title: >- 
  Reference: Custom Error Pages
layout: subsection
---

<a id="section_N10021_N1001E_N10001"></a>
While navigating an app, users occasionally get HTTP errors with obscure messages. To guide your users when they encounter these errors, you can override the error messages using custom error pages. Add custom error pages to display user-friendly messages tailored to your app.

## <a id="section_o1z_wm1_5db"></a>Supported HTTP Error Codes

Presentation Components can route these HTTP status codes from inbound and outbound endpoints to custom error pages. Presentation Components ignore all other status codes not included in this list.

-   301 - Moved permanently.
-   302 - Found.
-   303 - See other.
-   307 - Temporary redirect.
-   401 - Unauthorized.
-   404 - Not found.
-   407 - Proxy authentication required.
-   408 - Request timeout.
-   500 - Internal server error.
-   503 - Service unavailable.


For the standard descriptions of the status codes, see [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status).

The `ignoreFailures` attribute of an endpoint enables the app to ignore any of the listed status codes. If you don't specify these status codes in `ignoreFailures`, Presentation Components treat them as errors and route them to the appropriate custom error page.

The `failOnStatusCodes` attribute of an endpoint is the opposite. The `failOnStatusCodes` attribute enables the app to display an error when the endpoint returns any of the ignored status codes. If you don't specify ignored status codes in `failOnStatusCodes`, Presentation Components don't treat them as errors.

<b>Note:</b> You can't route the HTTP error codes from deferred inbound endpoints.

## <a id="section_ydc_qp1_5db"></a>errorPageConfigurations in the Site Metadata

To display a custom error page when your app encounters an HTTP error from an inbound or outbound endpoint, add an `errorPageConfigurations` section in the Site Metadata (SMD). Map the HTTP error code to an error page using the `statusCode` and `page` attributes.

```
"errorPageConfigurations": [
  {
    "statusCode": "401",
    "page": {
      "id": "errorPage"
    }
  }
]
```

You can map any or all of the supported HTTP error codes to their appropriate custom error pages. This sample maps the different HTTP errors to different custom error pages.

```
"errorPageConfigurations": [
  {
    "statusCode": "401",
    "page": {
      "id": "authError"
    }
  },
  {
    "statusCode": "404",
    "page": {
      "id": "notFoundError"
    }
  },
  {
    "statusCode": "500",
    "page": {
      "id": "internalServerError"
    }
  },
  {
    "statusCode": "503",
    "page": {
      "id" : "serviceUnavailableError"
    }
} ]
```

## <a id="section_pdr_vqt_vdb"></a>Custom Error Page

A custom error page is a PMD file that displays custom error messages. For each mapped HTTP error in the SMD, you can create the corresponding error page that displays the appropriate error message. You can use these variables that contain the HTTP error code and message:

-   `errorCode`
-   `errorMessage`


A custom error page overrides any `responseErrorDetail` tag specified with the endpoint.

This sample PMD is the custom error page referenced in the SMD for the 401 status code:

```
{
"id": "authError",
"endPoints": [
],
"presentation": {
"body": {
   "type": "section",
   "horizontal": false,
   "children": [
       {
           "type": "text",
           "id": "errorSummary",
           "label": "Error Message",
           "value": "We couldn't verify your identity, or your login session expired. Try again."
       },
       {
           "type": "text",
           "id": "errorDetails",
           "label": "HTTP Error code: <% errorCode %>",
           "value": "<% errorMessage %>"
       }
   ]
}
}
}
```

### Related Information

[Reference: Site Metadata](/wcp_docs/mwr1528410641805.html)

[endPoints](/wcp_docs/ujr1530565661647.html)

[outboundDataURI](/wcp_docs/yzz1530025276777.html)

