index.js
function patchMakeErrFromCode() {
  const func = errors.makeErrFromCode;
  function makeErrFromCodeHook() {
    const err = func.apply(null, arguments);
    patchErrorBody(err, {});
    return err;
  }
  errors.makeErrFromCode = makeErrFromCodeHook;

  // Deprecated.
  // See https://github.com/restify/errors/blob/master/lib/index.js#L126
  errors.codeToHttpError = makeErrFromCodeHook;
}
function patchMakeErrFromCode() {
  const func = errors.makeErrFromCode;
  function makeErrFromCodeHook() {
    const err = func.apply(null, arguments);
    patchErrorBody(err, {});
    return err;
  }
  errors.makeErrFromCode = makeErrFromCodeHook;

  // Deprecated.
  // See https://github.com/restify/errors/blob/master/lib/index.js#L126
  errors.codeToHttpError = makeErrFromCodeHook;
}
function patchMakeErrFromCode ( ) { const func = errors . makeErrFromCode ; function makeErrFromCodeHook ( ) { const err = func . apply ( null , arguments ) ; patchErrorBody ( err , { } ) ; return err ; } errors . makeErrFromCode = makeErrFromCodeHook ; // Deprecated. // See https://github.com/restify/errors/blob/master/lib/index.js#L126 errors . codeToHttpError = makeErrFromCodeHook ; }
Adds an hook to the makeErrFromCode method.
Adds an hook to the makeErrFromCode method .