// This helper file conatins a function that translates error objects into 
// meaningful, user-oriented error messages
function translateError(err){
    var message
    if(err === ''){
        message = ''
    }
    else{
        message = "An error occured"
    }
    
    return message
}

module.exports = translateError
@@ -167,23 +167,148 @@
     
-if(err === '
+//console.log('debug')%0A    //console.log(err.errors)%0A    if(Object.keys(err.errors).includes('firstName') && err.name === 'ValidationError
 ')
-%7B
 %0A   
@@ -327,68 +327,733 @@
  = '
-'%0A    %7D%0A    else%7B%0A        message = %22An error occured%22%0A    %7D
+First name can only letters, commas, periods, spaces and apostrophes'%0A    else if(Object.keys(err.errors).includes('lastName') && err.name === 'ValidationError')%0A        message = 'Last name can only letters, commas, periods, spaces and apostrophes'%0A    else if(Object.keys(err.errors).includes('username') && err.name === 'ValidationError')%0A        message = 'Username must at least be 5 characters and can contain letters, numbers, underscores, hyphens and periods'%0A    else if(Object.keys(err.errors).includes('password') && err.name === 'ValidationError')%0A        message = 'Password must at least 8 characters and must contain at least 1 number'%0A    // Default message error%0A    else%0A        message = %22An error occured%22
 %0A   

add validation error translation