summaryrefslogtreecommitdiff
path: root/src/services/i
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2019-04-14 04:17:24 +0900
committersyuilo <syuilotan@yahoo.co.jp>2019-04-14 04:17:24 +0900
commite3b3f8fac14fb4c4d150fb31c11ead1a193a36e0 (patch)
tree021d39efbb8ec59d098e06603bf86dae670773e0 /src/services/i
parentUpdate CHANGELOG.md (diff)
downloadmisskey-e3b3f8fac14fb4c4d150fb31c11ead1a193a36e0.tar.gz
misskey-e3b3f8fac14fb4c4d150fb31c11ead1a193a36e0.tar.bz2
misskey-e3b3f8fac14fb4c4d150fb31c11ead1a193a36e0.zip
Better error handling
Diffstat (limited to 'src/services/i')
-rw-r--r--src/services/i/pin.ts2
-rw-r--r--src/services/i/update.ts2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/services/i/pin.ts b/src/services/i/pin.ts
index f5c957c742..a6d2dfcdbf 100644
--- a/src/services/i/pin.ts
+++ b/src/services/i/pin.ts
@@ -78,7 +78,7 @@ export async function removePinned(user: User, noteId: Note['id']) {
export async function deliverPinnedChange(userId: User['id'], noteId: Note['id'], isAddition: boolean) {
const user = await Users.findOne(userId);
- if (user == null) throw 'user not found';
+ if (user == null) throw new Error('user not found');
if (!Users.isLocalUser(user)) return;
diff --git a/src/services/i/update.ts b/src/services/i/update.ts
index 2bb5c7a100..ddb6704a03 100644
--- a/src/services/i/update.ts
+++ b/src/services/i/update.ts
@@ -7,7 +7,7 @@ import { renderPerson } from '../../remote/activitypub/renderer/person';
export async function publishToFollowers(userId: User['id']) {
const user = await Users.findOne(userId);
- if (user == null) throw 'user not found';
+ if (user == null) throw new Error('user not found');
const followers = await Followings.find({
followeeId: user.id