src/Multipart/File.js
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`
  }
}
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`
  }
}
function ( type , data ) { if ( type === 'size' ) { return ` ${ bytes ( data . size ) } ` } if ( type === 'type' ) { const verb = data . types . length === 1 ? 'is' : 'are' return ` ${ data . subtype } ${ data . type } ${ data . types . join ( ', ' ) } ${ verb } ` } if ( type === 'extname' ) { const verb = data . extnames . length === 1 ? 'is' : 'are' return ` ${ data . extname } ${ data . extnames . join ( ', ' ) } ${ verb } ` } }
Returns the error string for given error
type

@method getError

@param  {String} type
@param  {Object} data

@return {String}
Returns the error string for given error type