File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
src/Magento/FunctionalTestingFramework/DataTransport/Auth Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -58,9 +58,14 @@ class WebApiAuth
58
58
public static function getAdminToken ($ username = null , $ password = null )
59
59
{
60
60
$ login = $ username ?? getenv ('MAGENTO_ADMIN_USERNAME ' );
61
- $ encryptedSecret = CredentialStore::getInstance ()->getSecret ('magento/MAGENTO_ADMIN_PASSWORD ' );
62
- $ secret = CredentialStore::getInstance ()->decryptSecretValue ($ encryptedSecret );
63
- $ password = $ password ?? $ secret ;
61
+ try {
62
+ $ encryptedSecret = CredentialStore::getInstance ()->getSecret ('magento/MAGENTO_ADMIN_PASSWORD ' );
63
+ $ secret = CredentialStore::getInstance ()->decryptSecretValue ($ encryptedSecret );
64
+ $ password = $ password ?? $ secret ;
65
+ } catch (TestFrameworkException $ e ) {
66
+ $ message = "Password not found in credentials file " ;
67
+ throw new FastFailException ($ message . $ e ->getMessage (), $ e ->getContext ());
68
+ }
64
69
if (!$ login || !$ password ) {
65
70
$ message = 'Cannot retrieve API token without credentials. Please fill out .env. ' ;
66
71
$ context = [
You can’t perform that action at this time.
0 commit comments