Ignore 4xx references in AP (#4463)
* Ignore 4xx references * remove unnecessary comment
This commit is contained in:
parent
0fff2e4f16
commit
c6cdfa2f5a
5 changed files with 38 additions and 21 deletions
|
|
@ -29,7 +29,19 @@ export default async function(resolver: Resolver, actor: IRemoteUser, activity:
|
|||
return;
|
||||
}
|
||||
|
||||
const renote = await resolveNote(note);
|
||||
// Announce対象をresolve
|
||||
let renote;
|
||||
try {
|
||||
renote = await resolveNote(note);
|
||||
} catch (e) {
|
||||
// 対象が4xxならスキップ
|
||||
if (e.statusCode >= 400 && e.statusCode < 500) {
|
||||
logger.warn(`Ignored announce target ${note.inReplyTo} - ${e.statusCode}`);
|
||||
return;
|
||||
}
|
||||
logger.warn(`Error in announce target ${note.inReplyTo} - ${e.statusCode || e}`);
|
||||
throw e;
|
||||
}
|
||||
|
||||
logger.info(`Creating the (Re)Note: ${uri}`);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue