Skip to content
Snippets Groups Projects
Unverified Commit ac4ea252 authored by syuilo's avatar syuilo
Browse files

Better error handling

parent faf017f3
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment