code: function (type, data) {
    if (type === 'size') {
      return `File size should be less than ${bytes(data.size)}`
    }
  
    if (type === 'type') {
      const verb = data.types.length === 1 ? 'is' : 'are'
      return `Invalid file type ${data.subtype} or ${data.type}. Only ${data.types.join(', ')} ${verb} allowed`
    }
  
    if (type === 'extname') {
      const verb = data.extnames.length === 1 ? 'is' : 'are'
      return `Invalid file extension ${data.extname}. Only ${data.extnames.join(', ')} ${verb} allowed`
    }
  }
docs: Returns the error string for given error
  type
  
  @method getError
  
  @param  {String} type
  @param  {Object} data
  
  @return {String}