Forward LDAP error code into exception and fix sprintf