1
0
mirror of https://github.com/QRouland/UTPass.git synced 2025-06-24 22:42:28 +00:00

Improve Lib Pass Error Messages

This commit is contained in:
2025-03-14 10:07:05 +01:00
parent bdb2d58ac4
commit dc2c35ca9b
7 changed files with 92 additions and 53 deletions

View File

@ -2,7 +2,6 @@ import "../../components"
import Pass 1.0
ImportFile {
id: importKeyFilePage
headerTitle: i18n.tr("GPG Key Import")
@ -23,9 +22,21 @@ ImportFile {
importKeyFilePage.activeTransfer = null;
PopupUtils.open(importKeyFilePage.dialogImportKeyPageSucess);
});
Pass.importGPGKeyFailed.connect(function(message) {
Pass.importGPGKeyFailed.connect(function(err, message) {
Utils.rmFile(importKeyFilePage.activeTransfer.items[0].url);
importKeyFilePage.activeTransfer = null;
switch (code) {
case 1: // UnexceptedError -> use the default (not translate) rnp error
__text_error_description = message;
break;
case 2: // BadFormat
__text_error_description = i18n.tr("The file is not in a valid key format");
break;
default:
console.warn("Unhandled error code");
__text_error_description = message;
break;
}
PopupUtils.open(importKeyFilePage.dialogImportKeyPageError);
});
}