Skip to content

Commit 92b9794

Browse files
committed
CABPI-467: Changed exception error messages
1 parent cf55a2c commit 92b9794

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/code/Magento/AdminAdobeIms/Model/Authorization/AdobeImsAdminTokenUserContext.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
namespace Magento\AdminAdobeIms\Model\Authorization;
99

1010
use Magento\AdminAdobeIms\Model\Auth;
11-
use Magento\AdobeImsApi\Api\IsTokenValidInterface;
1211
use Magento\AdminAdobeIms\Service\ImsConfig;
12+
use Magento\AdobeImsApi\Api\IsTokenValidInterface;
1313
use Magento\Authorization\Model\UserContextInterface;
1414
use Magento\Framework\Exception\AuthenticationException;
1515

@@ -80,13 +80,13 @@ public function getUserId(): ?int
8080
if (!empty($session->getAdobeAccessToken())) {
8181
$isTokenValid = $this->isTokenValid->validateToken($session->getAdobeAccessToken());
8282
if (!$isTokenValid) {
83-
throw new AuthenticationException(__('An authentication error occurred. Verify and try again.'));
83+
throw new AuthenticationException(__('Session Access Token is not valid'));
8484
}
8585
} else {
8686
try {
8787
$this->adminTokenUserService->processLoginRequest();
8888
} catch (\Exception $e) {
89-
throw new AuthenticationException(__('An authentication error occurred. Verify and try again.'));
89+
throw new AuthenticationException(__('Login request error. ') . $e->getMessage(), 0, $e);
9090
}
9191
}
9292

app/code/Magento/AdminAdobeIms/Test/Unit/Model/Authorization/AdobeImsAdminTokenUserContextTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public function testExceptionWhenAccessTokenNotValid(): void
118118
->willReturn(false);
119119

120120
$this->expectException(AuthenticationException::class);
121-
$this->expectExceptionMessage('An authentication error occurred. Verify and try again.');
121+
$this->expectExceptionMessage('Session Access Token is not valid');
122122

123123
$this->adobeImsAdminTokenUserContext->getUserId();
124124
}

0 commit comments

Comments
 (0)