Skip to content

Commit 054ab99

Browse files
authored
Merge pull request #147 from packbackbooks/mgmt-119-previous-exception
Pass the previous exception
2 parents 199510d + 8def62e commit 054ab99

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/LtiMessageLaunch.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ private function getPublicKey(): Key
304304
try {
305305
$response = $this->serviceConnector->makeRequest($request);
306306
} catch (TransferException $e) {
307-
throw new LtiException(static::ERR_NO_PUBLIC_KEY);
307+
throw new LtiException(static::ERR_NO_PUBLIC_KEY, previous: $e);
308308
}
309309
$publicKeySet = $this->serviceConnector->getResponseBody($response);
310310

@@ -442,7 +442,7 @@ protected function validateJwtSignature(): self
442442
JWT::decode($this->request['id_token'], $public_key, $headers);
443443
} catch (ExpiredException $e) {
444444
// Error validating signature.
445-
throw new LtiException(static::ERR_INVALID_SIGNATURE);
445+
throw new LtiException(static::ERR_INVALID_SIGNATURE, previous: $e);
446446
}
447447

448448
return $this;

0 commit comments

Comments
 (0)