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