Given the way this reads, KNOWN_LDAP_ERRORS should probably map to a human readable message, rather than being an if