Skip to content

Commit

Permalink
Raise missing partner/org errors also for partnership
Browse files Browse the repository at this point in the history
  • Loading branch information
chadgates committed May 4, 2024
1 parent c4be1f0 commit 29af788
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pyas2lib/as2.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,12 +635,13 @@ def parse(
self.receiver, self.sender = find_org_partner_cb(org_id, partner_id)
elif find_org_cb and find_partner_cb:
self.receiver = find_org_cb(org_id)
if not self.receiver:
raise PartnerNotFound(f"Unknown AS2 organization with id {org_id}")

self.sender = find_partner_cb(partner_id)
if not self.sender:
raise PartnerNotFound(f"Unknown AS2 partner with id {partner_id}")

if not self.receiver:
raise PartnerNotFound(f"Unknown AS2 organization with id {org_id}")

if not self.sender:
raise PartnerNotFound(f"Unknown AS2 partner with id {partner_id}")

if find_message_cb and find_message_cb(self.message_id, partner_id):
raise DuplicateDocument(
Expand Down

0 comments on commit 29af788

Please sign in to comment.