Skip to content

Commit

Permalink
Update catch Exception type
Browse files Browse the repository at this point in the history
  • Loading branch information
MishNajam committed Oct 10, 2023
1 parent 8027ab4 commit 62db8b7
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

namespace App\Service\Authentication;

use Exception;
use Facile\OpenIDClient\Client\ClientBuilder;
use Facile\OpenIDClient\Client\Metadata\ClientMetadata;
use Facile\OpenIDClient\Issuer\IssuerBuilder;
use Facile\OpenIDClient\Issuer\IssuerBuilderInterface;
use Facile\OpenIDClient\Service\Builder\AuthorizationServiceBuilder;
use Psr\Log\InvalidArgumentException;
use Psr\Log\LoggerInterface;

use RuntimeException;

use function Facile\OpenIDClient\base64url_encode;

class AuthenticationService
Expand Down Expand Up @@ -63,9 +64,9 @@ public function redirect(string $uiLocale): string
'claims' => '{"userinfo":{"https://vocab.account.gov.uk/v1/coreIdentityJWT": null}}',
]
);
} catch (InvalidArgumentException $e) {
} catch (Exception $e) {
$this->logger->error('Unable to get authorisation uri: ' . $e->getMessage());
throw $e;
throw new RuntimeException('Could not create authorisation uri');

Check warning on line 69 in service-api/app/src/App/src/Service/Authentication/AuthenticationService.php

View check run for this annotation

Codecov / codecov/patch

service-api/app/src/App/src/Service/Authentication/AuthenticationService.php#L67-L69

Added lines #L67 - L69 were not covered by tests
}

return $redirectAuthorisationUri;
Expand Down

0 comments on commit 62db8b7

Please sign in to comment.