Tweak error report

This commit is contained in:
Manav Rathi 2024-05-24 10:19:53 +05:30
parent eaf8b9cebc
commit fec040e528
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

View file

@ -80,7 +80,7 @@ const _codeFromURIString = (id: string, uriString: string): Code => {
const parseType = (url: URL): Code["type"] => { const parseType = (url: URL): Code["type"] => {
const t = url.host.toLowerCase(); const t = url.host.toLowerCase();
if (t == "totp" || t == "hotp") return t; if (t == "totp" || t == "hotp") return t;
throw new Error(`Unsupported code with host ${t}`); throw new Error(`Unsupported code with host "${t}"`);
}; };
const parseAccount = (url: URL): string | undefined => { const parseAccount = (url: URL): string | undefined => {

View file

@ -35,7 +35,7 @@ export const getAuthCodes = async (): Promise<Code[]> => {
); );
return codeFromURIString(entity.id, decryptedCode); return codeFromURIString(entity.id, decryptedCode);
} catch (e) { } catch (e) {
log.error(`failed to parse codeId = ${entity.id}`); log.error(`Failed to parse codeID ${entity.id}`, e);
return null; return null;
} }
}), }),