Skip to content

Latest commit

 

History

History
133 lines (86 loc) · 2.09 KB

File metadata and controls

133 lines (86 loc) · 2.09 KB

errorPage

Errors originating in the application router show the HTTP status code of the error. It is possible to display a custom error page using the errorPage property.

The property is an array of objects, each object can have the following properties:

Application Router: errorPage Properties

Property

Type

Mandatory

Description

status

Number/Array

Yes

HTTP status code.

file

String

Yes

File path relative to the working directory of the application router.

path

String

Yes

URL path relative to the HTML application root folder

Here is an example:

Sample Code:

{ "errorPage" : [
    {"status": [400,401,402], "file": "./custom-err-40x.html"},
    {"status": 501, "file": "./http_resources/custom-err-501.html"}
    {"status": 403, "path": "/forbidden.html"}
  ]
}

In this code example, errors with status code “400”, “401” and “402” will show the content of ./custom-err-4xx.html. Errors with the status code “501” will display the content of ./http_resources/custom-err-501.html For errors with status code 403, the user is redirected to "/forbidden.html".

To avoid errors when redirecting to an error page that is stored in the HTML5 Application Repository service, define a route without authentication to the error page. For example:

Sample Code:

{
  "source": "^/forbidden.html$",
  "service": "html5-apps-repo-rt",
  "authenticationType": "none"
}

Note:

The contents of the errorPage configuration section have no effect on errors that are not generated by the application router.