Skip to content

Commit 9835ddb

Browse files
corrected err message
1 parent ec681cd commit 9835ddb

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/authentication/util/Utility.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,13 @@ exports.readPrivateKeyFromPemFile = function(filePath, password, logger) {
270270

271271
return forge.pki.privateKeyToPem(privateKey);
272272
} catch (error) {
273-
logger.error(`Error parsing private key from ${filePath}: ${error.message}`);
274-
ApiException.AuthException(`Error parsing private key from ${filePath}: ${error.message}`);
273+
if (isEncrypted) {
274+
logger.error(`Error decrypting private key from ${filePath}: ${error.message}. This may be due to an incorrect password.`);
275+
ApiException.AuthException(`Error decrypting private key from ${filePath}: ${error.message}. ${Constants.INCORRECT_KEY_PASS}`);
276+
} else {
277+
logger.error(`Error parsing private key from ${filePath}: ${error.message}`);
278+
ApiException.AuthException(`Error parsing private key from ${filePath}: ${error.message}`);
279+
}
275280
}
276281
} catch (error) {
277282
logger.error(`Error loading private key from PEM file: ${filePath}: ${error.message}`);

0 commit comments

Comments
 (0)