From 7948a3a11bb78e7d3925a2835418c71ee2b2e56a Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 4 Feb 2019 09:02:23 +0900 Subject: [PATCH] Better error log of WebFinger --- src/remote/resolve-user.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/remote/resolve-user.ts b/src/remote/resolve-user.ts index 8deba6e21..f4e6a138e 100644 --- a/src/remote/resolve-user.ts +++ b/src/remote/resolve-user.ts @@ -78,7 +78,10 @@ export default async (username: string, _host: string, option?: any, resync?: bo async function resolveSelf(acctLower: string) { logger.info(`WebFinger for ${chalk.yellow(acctLower)}`); - const finger = await webFinger(acctLower); + const finger = await webFinger(acctLower).catch(e => { + logger.error(`Failed to WebFinger for ${chalk.yellow(acctLower)}: ${e.message} (${e.status})`); + throw e; + }); const self = finger.links.find(link => link.rel && link.rel.toLowerCase() === 'self'); if (!self) { throw new Error('self link not found');