Skip to content

Commit ac05ebe

Browse files
committed
Make exception message more verbose
By adding the SP entity id and the collabPersonId to the message. The Exception message that was originally added to the message was removed. Why? The original exception is also set as the parent exception on the new message. So the message can always be read there.
1 parent 57bdf1b commit ac05ebe

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/OpenConext/EngineBlock/Service/ConsentService.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,16 @@ public function countAllFor($userId)
9696

9797
public function deleteOneConsentFor(CollabPersonId $id, string $serviceProviderEntityId): bool
9898
{
99+
$collabPersonId = $id->getCollabPersonId();
99100
try {
100-
return $this->consentRepository->deleteOneFor($id->getCollabPersonId(), $serviceProviderEntityId);
101+
return $this->consentRepository->deleteOneFor($collabPersonId, $serviceProviderEntityId);
101102
} catch (Exception $e) {
102103
throw new RuntimeException(
103-
sprintf('An exception occurred while removing consent for a service provider("%s")', $e->getMessage()),
104+
sprintf(
105+
'An exception occurred while removing consent for a service provider("%s") and user ("%s").',
106+
$serviceProviderEntityId,
107+
$collabPersonId
108+
),
104109
0,
105110
$e
106111
);

0 commit comments

Comments
 (0)