Better error log of WebFinger
This commit is contained in:
parent
3117ea56d8
commit
7948a3a11b
1 changed files with 4 additions and 1 deletions
|
@ -78,7 +78,10 @@ export default async (username: string, _host: string, option?: any, resync?: bo
|
||||||
|
|
||||||
async function resolveSelf(acctLower: string) {
|
async function resolveSelf(acctLower: string) {
|
||||||
logger.info(`WebFinger for ${chalk.yellow(acctLower)}`);
|
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');
|
const self = finger.links.find(link => link.rel && link.rel.toLowerCase() === 'self');
|
||||||
if (!self) {
|
if (!self) {
|
||||||
throw new Error('self link not found');
|
throw new Error('self link not found');
|
||||||
|
|
Loading…
Reference in a new issue