     return callback err if err
 
     if not result?.auditMessage
-      return callback 'Document is not a valid AuditMessage'
+      return callback new Error 'Document is not a valid AuditMessage'
 
     audit = {}
 

    delete audit.syslog.message

    audit.save (saveErr) ->
      if err or saveErr
        logger.error "An error occurred while processing the audit entry: #{err}"

      callback()

    logger.info 'Invalid message received'
    return callback()

  parseAuditRecordFromXML parsedMsg.message, (xmlErr, result) ->
    audit = new Audit result

    audit.rawMessage = msg
