Skip to content

Commit

Permalink
✨ Handle pydantic.ValidationError when resolving did
Browse files Browse the repository at this point in the history
Signed-off-by: ff137 <ff137@proton.me>
  • Loading branch information
ff137 committed Dec 11, 2024
1 parent 764e052 commit 83070ee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion acapy_agent/connections/base_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import logging
from typing import Dict, List, Optional, Sequence, Text, Tuple, Union

import pydantic
import pydid
from base58 import b58decode
from did_peer_2 import KeySpec, generate
Expand Down Expand Up @@ -444,7 +445,7 @@ async def resolve_didcomm_services(
try:
doc_dict: dict = await resolver.resolve(self._profile, did, service_accept)
doc: ResolvedDocument = pydid.deserialize_document(doc_dict, strict=True)
except ResolverError as error:
except (ResolverError, pydantic.ValidationError) as error:
raise BaseConnectionManagerError("Failed to resolve DID services") from error

if not doc.service:
Expand Down

0 comments on commit 83070ee

Please sign in to comment.