code: function handleError(type, filepath, opts, cb) {
    return function(err) {
      switch (type) {
        case 'read':
          if (err.code === 'ENOENT') {
            err.message = formatError('file does not exist', filepath, err);
          } else {
            err.message = formatError('cannot read file', filepath, err);
          }
          break;
        case 'write':
          if (!opts.overwrite && err.code === 'EEXIST') {
            return cb();
          }
          err.message = formatError('cannot write to', filepath, err);
          break;
      }
      cb(err);
    };
  }
docs: Handle errors with custom message formatting.
  
  @param {String} `type` types are "read" or "write"
  @param {String} `filepath` filepath that caused the error
  @param {Object} `options`
  @param {Function} `cb` callback function