code: function makeError(code, message, data = {}) {
    const error = new Error(message);
    return Object.assign(error, {code, data});
  }
docs: Simple helper function that assign an error code to an error, so that it can more easily be caught and used
  by third-parties.