Bug 1529495 - Output the result of ::GetLastError when CryptProtectData\CryptUnprotectData fails. r=MattN

Differential Revision: https://phabricator.services.mozilla.com/D20627

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jared Wein 2019-02-21 15:36:12 +00:00
Родитель f777b77069
Коммит 5b3fd4530e
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -167,7 +167,7 @@ OSCrypto.prototype = {
null, null, FLAGS_NOT_SET,
outData.address());
if (status === 0) {
throw new Error("decryptData failed: " + status);
throw new Error("decryptData failed: " + ctypes.winLastError);
}
// convert byte array to JS string.
@ -213,7 +213,7 @@ OSCrypto.prototype = {
null, null, FLAGS_NOT_SET,
outData.address());
if (status === 0) {
throw new Error("encryptData failed: " + status);
throw new Error("encryptData failed: " + ctypes.winLastError);
}
// convert byte array to JS string.