From 874c0eae6a64c144113d61fe010ec0ca1b9ff4c4 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 8deba6e21e..f4e6a138e7 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');