Log exceptions from accessSecretStorage
Rather than ignoring everything assuming the user cancelled
This commit is contained in:
parent
68b2454920
commit
26c9b64c3b
2 changed files with 11 additions and 2 deletions
|
@ -29,6 +29,12 @@ import { _t } from './languageHandler';
|
|||
let secretStorageKeys = {};
|
||||
let cachingAllowed = false;
|
||||
|
||||
export class AccessCancelledError extends Error {
|
||||
constructor() {
|
||||
super("Secret storage access canceled");
|
||||
}
|
||||
}
|
||||
|
||||
async function getSecretStorageKey({ keys: keyInfos }) {
|
||||
const keyInfoEntries = Object.entries(keyInfos);
|
||||
if (keyInfoEntries.length > 1) {
|
||||
|
@ -66,7 +72,7 @@ async function getSecretStorageKey({ keys: keyInfos }) {
|
|||
);
|
||||
const [input] = await finished;
|
||||
if (!input) {
|
||||
throw new Error("Secret storage access canceled");
|
||||
throw new AccessCancelledError();
|
||||
}
|
||||
const key = await inputToKey(input);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue