From e3b3f8fac14fb4c4d150fb31c11ead1a193a36e0 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 14 Apr 2019 04:17:24 +0900 Subject: Better error handling --- src/remote/activitypub/kernel/follow.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/remote/activitypub/kernel/follow.ts') diff --git a/src/remote/activitypub/kernel/follow.ts b/src/remote/activitypub/kernel/follow.ts index d37404502f..c255067bfd 100644 --- a/src/remote/activitypub/kernel/follow.ts +++ b/src/remote/activitypub/kernel/follow.ts @@ -6,7 +6,7 @@ import { Users } from '../../../models'; export default async (actor: IRemoteUser, activity: IFollow): Promise => { const id = typeof activity.object == 'string' ? activity.object : activity.object.id; - if (id == null) throw 'missing id'; + if (id == null) throw new Error('missing id'); if (!id.startsWith(config.url + '/')) { return; -- cgit v1.2.3-freya