リプライ先をエラー時に無視すると本来は投票なのに投票じゃないと扱われおかしくなるのでエラーにするように
This commit is contained in:
parent
53d46d1cbe
commit
8cb9852058
|
@ -120,13 +120,15 @@ export async function createNote(value: any, resolver?: Resolver, silent = false
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
// リプライ
|
// リプライ
|
||||||
const reply: Note | undefined | null = note.inReplyTo
|
const reply: Note | null = note.inReplyTo
|
||||||
? await resolveNote(note.inReplyTo, resolver).catch(e => {
|
? await resolveNote(note.inReplyTo, resolver).then(x => {
|
||||||
// 4xxの場合はリプライしてないことにする
|
if (x == null) {
|
||||||
if (e.statusCode >= 400 && e.statusCode < 500) {
|
logger.warn(`Specified inReplyTo, but nout found`);
|
||||||
logger.warn(`Ignored inReplyTo ${note.inReplyTo} - ${e.statusCode} `);
|
throw 'inReplyTo not found';
|
||||||
return null;
|
} else {
|
||||||
|
return x;
|
||||||
}
|
}
|
||||||
|
}).catch(e => {
|
||||||
logger.warn(`Error in inReplyTo ${note.inReplyTo} - ${e.statusCode || e}`);
|
logger.warn(`Error in inReplyTo ${note.inReplyTo} - ${e.statusCode || e}`);
|
||||||
throw e;
|
throw e;
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue