From eac931ad4a901a7c5f2e967d6e9a6350149039ff Mon Sep 17 00:00:00 2001 From: Nikos Date: Mon, 2 Sep 2024 11:43:44 +0300 Subject: [PATCH] fix: properly raise pydantic exception --- lib/charms/glauth_k8s/v0/ldap.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/charms/glauth_k8s/v0/ldap.py b/lib/charms/glauth_k8s/v0/ldap.py index 9c6b1b9c..206c3ac8 100644 --- a/lib/charms/glauth_k8s/v0/ldap.py +++ b/lib/charms/glauth_k8s/v0/ldap.py @@ -155,7 +155,7 @@ def _on_ldap_requested(self, event: LdapRequestedEvent) -> None: # Increment this PATCH version before using `charmcraft publish-lib` or reset # to 0 if you are raising the major API version -LIBPATCH = 5 +LIBPATCH = 6 PYDEPS = ["pydantic~=2.5.3"] @@ -242,7 +242,7 @@ def validate_ldap_urls(cls, vs: List[str] | str) -> List[str]: for v in vs: if not v.startswith("ldap://"): - raise ValidationError("Invalid LDAP URL scheme.") + raise ValidationError.from_exception_data("Invalid LDAP URL scheme.") return vs