src/navigation.js
function showError(cfg = {}) {
    if (_.isBoolean(cfg) && !cfg && errorDoc) { // hide error
        navigationDocument.removeDocument(errorDoc);
        return;
    }
    if (_.isString(cfg)) {
        cfg = {
            data: {
                message: cfg
            }
        };
    }
    // use default error template if not passed as a configuration
    _.defaultsDeep(cfg, {
        template: defaults.templates.error
    });

    console.log('showing error... options:', cfg);

    // cache the doc for later use
    errorDoc = show(cfg);

    return errorDoc;
}
function showError(cfg = {}) {
    if (_.isBoolean(cfg) && !cfg && errorDoc) { // hide error
        navigationDocument.removeDocument(errorDoc);
        return;
    }
    if (_.isString(cfg)) {
        cfg = {
            data: {
                message: cfg
            }
        };
    }
    // use default error template if not passed as a configuration
    _.defaultsDeep(cfg, {
        template: defaults.templates.error
    });

    console.log('showing error... options:', cfg);

    // cache the doc for later use
    errorDoc = show(cfg);

    return errorDoc;
}
function showError ( cfg = { } ) { if ( _ . isBoolean ( cfg ) && ! cfg && errorDoc ) { // hide error navigationDocument . removeDocument ( errorDoc ) ; return ; } if ( _ . isString ( cfg ) ) { cfg = { data : { message : cfg } } ; } // use default error template if not passed as a configuration _ . defaultsDeep ( cfg , { template : defaults . templates . error } ) ; console . log ( 'showing error... options:' , cfg ) ; // cache the doc for later use errorDoc = show ( cfg ) ; return errorDoc ; }
Shows the error page using the existing error template.
Also applies any default handlers and caches the document for later use.

@inner
@alias module:navigation.showError

@param  {Object|Function|Boolean} cfg    The configuration options or the template function or boolean to hide the error
@return {Document}                       The created error document.
Shows the error page using the existing error template . Also applies any default handlers and caches the document for later use .