Better error handling

This commit is contained in:
syuilo
2019-04-14 04:17:24 +09:00
parent b390363b25
commit e3b3f8fac1
25 changed files with 52 additions and 52 deletions

View File

@ -6,7 +6,7 @@ import { Users } from '../../../../models';
export default async (actor: IRemoteUser, activity: IFollow): Promise<void> => {
const id = typeof activity.actor == 'string' ? activity.actor : activity.actor.id;
if (id == null) throw 'missing id';
if (id == null) throw new Error('missing id');
if (!id.startsWith(config.url + '/')) {
return;