Skip to content

Commit

Permalink
fix: properly raise pydantic exception
Browse files Browse the repository at this point in the history
  • Loading branch information
nsklikas committed Sep 2, 2024
1 parent 694b553 commit eac931a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/charms/glauth_k8s/v0/ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit eac931a

Please sign in to comment.