Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

My web app is hosted with the Aerobatic add-on for Bitbucket, and now I'd like to add a custom error page such as a 404 Page Not Found.

Step-by-step guide

  1. Navigate to your web site's repository
  2. Create a new HTML file named 404.html. You can have this file in your root or in a folder such as /errors, for example. 
  3. Add your cool Page Not Found content in your newly created 404.html file.
  4. Repeat Steps 2 and 3 for each custom error you want to handle. Aerobatic supports the following error codes: 400, 404, 401, 403, 500
  5. Either create a package.json file or, in your existing package.json, add the following code block. Make sure your package.json is in the root level of your repository.

Code Block
languagejs
themeMidnight
titlepackage.json
{
  "_virtualApp": {
    "router": [
      {
        "module": "custom-errors",
        "options": {
          "errors": {
            "500": "errors/500.html",
            "404": "errors/404.html",
            "401": "errors/401.html"
          }
        }
      },
      {
        "module": "webpage"
      }
    ]
  }
}

Sample App

Further Documentation

Full documentation on custom errors can be found on 4front.io which is the open-source project that Aerobatic is built on.

http://4front.io/docs/plugins/custom-errors.html

Filter by label (Content by label)
showLabelsfalse
max5
spacesAKB
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel = "errors" and type = "page" and space = "AKB"
labelserrors

...