Skip to content

Commit 9940386

Browse files
committed
Catch dynamic Trust Mark resloving errors
1 parent 20c126a commit 9940386

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

src/Controllers/Admin/ConfigController.php

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,20 @@ function (string $token): Federation\TrustMark {
8484
* @var non-empty-string $trustMarkIssuerId
8585
*/
8686
foreach ($dynamicTrustMarks as $trustMarkType => $trustMarkIssuerId) {
87-
$trustMarkIssuerConfigurationStatement = $this->federation->entityStatementFetcher()
88-
->fromCacheOrWellKnownEndpoint($trustMarkIssuerId);
87+
try {
88+
$trustMarkIssuerConfigurationStatement = $this->federation->entityStatementFetcher()
89+
->fromCacheOrWellKnownEndpoint($trustMarkIssuerId);
8990

90-
$trustMarks[] = $this->federation->trustMarkFetcher()->fromCacheOrFederationTrustMarkEndpoint(
91-
$trustMarkType,
92-
$this->moduleConfig->getIssuer(),
93-
$trustMarkIssuerConfigurationStatement,
94-
);
91+
$trustMarks[] = $this->federation->trustMarkFetcher()->fromCacheOrFederationTrustMarkEndpoint(
92+
$trustMarkType,
93+
$this->moduleConfig->getIssuer(),
94+
$trustMarkIssuerConfigurationStatement,
95+
);
96+
} catch (\Exception $e) {
97+
$message = Translate::noop('Error fetching dynamic trust mark: ') .
98+
"trust_mark_type => $trustMarkType, issuer_id => $trustMarkIssuerId. " . $e->getMessage();
99+
$this->sessionMessagesService->addMessage($message);
100+
}
95101
}
96102
}
97103

0 commit comments

Comments
 (0)