Get an error document.

@inner
@alias module:navigation.getErrorDoc

@param  {Object|String} message          Error page configuration or error message
@return {Document}                       A newly created error document
484519
function getErrorDoc(message) {
    let cfg = {};
    if (_.isPlainObject(message)) {
        cfg = message;
        if (cfg.status && !cfg.template && defaults.templates.status[cfg.status]) {
            cfg.template = defaults.templates.status[cfg.status];
        }
    } else {
        cfg.template = defaults.templates.error || (() => '<document></document>');
        cfg.data = {message: message};
    }

    return Page.makeDom(cfg);
}
772782
function (err) {
    var msg = '';
    var t$ = Tool;
    try {
      if (t$.isString(err)) {
        msg = err;
      } else if (t$.isError(err)) {
        msg = err.message;
      } else if (t$.isObject(err)) {
        var errMsg = [];
        for (var p in err) {
          if (err.hasOwnProperty(p)) {
            errMsg.push(p + '=' + err[p]);
          }
        }
        if (errMsg.length === 0) {
          msg = err;
        } else {
          msg = errMsg.join('\n');
        }
      } else {
        msg += '[RTY_CANT_TYPE] = ' + t$.getType(err);
        msg += JSON.stringify(err);
      }
    } catch (error) {
      throw error
    }

    return msg
  }
786304
function formErrorText (info, msg) {
  const hr = '----------'

  return addPlatformInformation(info)
  .then((obj) => {
    const formatted = []

    function add (msg) {
      formatted.push(
        stripIndents(msg)
      )
    }

    add(`
      ${obj.description}

      ${obj.solution}

    `)

    if (msg) {
      add(`
        ${hr}

        ${msg}

      `)
    }

    add(`
      ${hr}

      ${obj.platform}
    `)

    if (obj.footer) {
      add(`

        ${hr}

        ${obj.footer}
      `)
    }

    return formatted.join('\n\n')
  })
}
95854
function toError(msg, cause) {
  var err = new Error(msg);
  err.cause = cause;
  return err;
}
566704
function error (message, error) {
    // get model name
    var modelName = defined(this) && defined(this.name) ? this.name : 'ImmutableCoreModel'
    // build custom error message
    message = `${modelName} error` + (
        typeof message === 'string'
            ? `: ${message}`
            : ''
    )
    // use error object passed in
    if (defined(error)) {
        // create data object with original message
        error.data = {
            error: {
                code: error.code,
                message: error.message,
            },
        }
    }
    // create new error message
    else {
        error = new Error(message)
        error.data = {}
    }

    return error
}
289533
public static function searcherror($message)
    {
        if (self::$loadConfigs === false) {
            App::config('debug');
            self::$loadConfigs = true;
        }

        $link = App::env('searcherror');

        if (strpos($link, '%error%') === -1) {
            return $message;
        }

        return preg_replace_callback('#^([\s\S]+?)\s+in\s+([\s\S]+?:\d+)|^([\s\S]+?)$#', function ($matches) use ($link)
        {
            $error = empty($matches[3]) ? $matches[1] : $matches[3];

            $url = str_replace('%error%', urlencode($error), $link);
            $url = htmlentities($url);

            return '<a target="_blank" href="' . $url . '">' . $error . '</a>' .
                    (empty($matches[2]) ? '' : (' in ' . $matches[2]));

        }, $message);
    }
232397
function get (manager, errorInfoCb, id) {
  const value = manager.store.get(id)
  if (_.isUndefined(value)) {
    const errorInfo = errorInfoCb(id)
    const e = new Error(errorInfo.message)
    e.name = errorInfo.name
    throw e
  }

  return value
}
206333
function err(...messages) {
  console.error(...messages);
  const p = document.createElement('p');
  p.innerText = messages.join(' ');
  p.style = 'color: red';
  logElement.appendChild(p);
}
123603
function getErrorMessage(errors) {
    var fullMessage = '';
    errors.forEach(function (err) {
        var message = ajv.errorsText([err]);
        if (message.indexOf('should NOT have additional properties') < 0) {
            fullMessage += message + os.EOL;
        }
        else {
            fullMessage += message + '. Offending property : ' + err.params.additionalProperty + os.EOL;
        }
    });
    return fullMessage;
}
1052795
def _get_error_message(response):
    """"""
    try:
        data = response.json()
        if "error_description" in data:
            return data['error_description']
        if "error" in data:
            return data['error']
    except Exception:
        pass

    return "Unknown error"
1362568
public String getErrorMessage() {
        final Object result = getStateHelper().eval(PropertyKeys.errorMessage);
        if (result == null) {
            return null;
        }
        return result.toString();
    }
1232405
function getOnError (msg) {
            return function getLastFoundDevicesErrorHandler (err) {
                console.error('An Error', err, msg, err.stack);
                var errDefered = q.defer();
                errDefered.reject(err);
                return errDefered.promise;
            };
        }
718675
function DispatchError(message) {
  Error.call(this);
  Error.captureStackTrace(this, arguments.callee);
  this.name = 'DispatchError';
  this.message = message;
}
319351
function getError (type, expected, actual) {
        return {
            attribute: type,
            expected: expected,
            actual: actual,
            message: getMsg(type, expected)
        };
    }
893498
function error( message, errors ) {
      const trim = _ => _.replace( /^\s+/, '' ).replace( /\s+$/, '' );
      const ajvMessage = ajv.errorsText( errors, { dataVar: '' } );
      const error = new Error(
         `${message}: ${trim(ajvMessage)} ${JSON.stringify(errors.map(e => e.params))}`
      );
      error.name = 'ValidationError';
      error.errors = errors;
      return error;
   }
624866
function createHtmlDocument (message) {
  var body = escapeHtml(message)
    .replace(NEWLINE_REGEXP, '<br>')
    .replace(DOUBLE_SPACE_REGEXP, ' &nbsp;')

  return '<!DOCTYPE html>\n' +
    '<html lang="en">\n' +
    '<head>\n' +
    '<meta charset="utf-8">\n' +
    '<title>Error</title>\n' +
    '</head>\n' +
    '<body>\n' +
    '<pre>' + body + '</pre>\n' +
    '</body>\n' +
    '</html>\n'
}
62867
function error (message, error) {
    // build custom error message
    message = `${this.model.name}#${this.id} record error` + (
        typeof message === 'string'
            ? `: ${message}`
            : ''
    )
    // use error object passed in
    if (defined(error)) {
        // create data object with original message
        error.data = {
            message: error.message,
        }
    }
    // create new error message
    else {
        error = new Error(message)
        error.data = {}
    }
    // set record data for error
    error.data.record = this

    return error
}