Now.js Framework Documentation

Now.js Framework Documentation

ErrorRenderer

EN 18 Nov 2026 02:27

ErrorRenderer

ErrorRenderer - Renders formatted error pages Used to display beautiful error pages with full functionality

Generated from source on 2026-08-21. Descriptions come from JSDoc in the file.
Re-run docs_scaffold when the code changes; hand edits are lost on regeneration

Source

  • File: Now/js/ErrorRenderer.js
  • Form: ES class

Public methods (7)

static attachEventListeners(container, config)

Attach event listeners

static generateActionsHtml(actions)

Builds the buttons for config.actions ([{text, type, action}]): the text is escaped, type becomes a btn-<type> class and action the button's data-action.

static generateErrorHtml(error, config)

Generate error HTML. config.title, config.message and the error text are escaped: they are shown as text, never as markup. The config.actions buttons come before the help text.

Error page buttons

renderNetworkError() has Try Again and Go Home buttons; renderAuthError() has Go to Login.
data-action="reload" reloads the page · home goes to the app's home through RedirectManager.go('/')
(the router base, not the site root /) · login in renderAuthError() does what a 401 does
(RedirectManager.redirectForStatus(401)) · any other action calls config.customHandlers[action].

Before this was fixed actions were never drawn as buttons, and the Home/Login handlers went to the
site's / and /login regardless of the base.

static render404(options = {})

Render 404 error

static renderAuthError(options = {})

Render authentication error

static renderError(error, options = {})

Render application error

static renderNetworkError(options = {})

Render network error

Data attributes used

data-action

Depends on

Utils