Skip to content

Commit

Permalink
Update ldap.py: improve message readability upon ldap exception
Browse files Browse the repository at this point in the history
  • Loading branch information
alexAubin authored Jan 20, 2025
1 parent 67e020a commit f098086
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/utils/ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,12 @@ def update(self, rdn, attr_dict, new_rdn=False):
self.con.modify_ext_s(dn, ldif)
except Exception as e:
raise MoulinetteError(
"error during LDAP update operation with: rdn='%s', "
"attr_dict=%s, new_rdn=%s, ldif=%s and exception: %s"
% (rdn, attr_dict, new_rdn, ldif, e),
"Error during LDAP update operation:\n"
f" rdn: {rdn}\n"
f" attr_dict: {attr_dict}\n"
f" new_rdn: {new_rdn}\n"
f" ldif: {ldif}\n"
f" exception: {e}",
raw_msg=True,
)
else:
Expand Down

0 comments on commit f098086

Please sign in to comment.