1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-12-01 08:18:45 +09:00

Better error handling

This commit is contained in:
syuilo 2019-04-18 00:09:08 +09:00
parent faf017f333
commit ac4ea25267
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69

View File

@ -2,6 +2,7 @@ import { IRemoteUser } from '../../../models/entities/user';
import { ILike } from '../type';
import create from '../../../services/note/reaction/create';
import { Notes } from '../../../models';
import { apLogger } from '../logger';
export default async (actor: IRemoteUser, activity: ILike) => {
const id = typeof activity.object == 'string' ? activity.object : activity.object.id;
@ -14,7 +15,8 @@ export default async (actor: IRemoteUser, activity: ILike) => {
const note = await Notes.findOne(noteId);
if (note == null) {
throw new Error();
apLogger.warn(`Like activity recivied, but no such note: ${id}`, { id });
return;
}
await create(actor, note, activity._misskey_reaction);