summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/NoteCreateService.ts
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2025-06-09 10:53:59 +0000
committerHazelnoot <acomputerdog@gmail.com>2025-06-09 10:53:59 +0000
commit00c0bdbc947ea0a049d920f73467be62d88f6858 (patch)
tree23c3e4281a10141948fcfc39239da4b388e781af /packages/backend/src/core/NoteCreateService.ts
parentmerge: Fix inverted condition in resolveLocal (!1103) (diff)
parentfix merge error (diff)
downloadsharkey-00c0bdbc947ea0a049d920f73467be62d88f6858.tar.gz
sharkey-00c0bdbc947ea0a049d920f73467be62d88f6858.tar.bz2
sharkey-00c0bdbc947ea0a049d920f73467be62d88f6858.zip
merge: Reduce log spam (!1004)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1004 Approved-by: dakkar <dakkar@thenautilus.net> Approved-by: Marie <github@yuugi.dev>
Diffstat (limited to 'packages/backend/src/core/NoteCreateService.ts')
-rw-r--r--packages/backend/src/core/NoteCreateService.ts12
1 files changed, 5 insertions, 7 deletions
diff --git a/packages/backend/src/core/NoteCreateService.ts b/packages/backend/src/core/NoteCreateService.ts
index 097d657ba3..4dceb6e953 100644
--- a/packages/backend/src/core/NoteCreateService.ts
+++ b/packages/backend/src/core/NoteCreateService.ts
@@ -296,7 +296,7 @@ export class NoteCreateService implements OnApplicationShutdown {
case 'followers':
// 他人のfollowers noteはreject
if (data.renote.userId !== user.id) {
- throw new Error('Renote target is not public or home');
+ throw new IdentifiableError('b6352a84-e5cd-4b05-a26c-63437a6b98ba', 'Renote target is not public or home');
}
// Renote対象がfollowersならfollowersにする
@@ -304,7 +304,7 @@ export class NoteCreateService implements OnApplicationShutdown {
break;
case 'specified':
// specified / direct noteはreject
- throw new Error('Renote target is not public or home');
+ throw new IdentifiableError('b6352a84-e5cd-4b05-a26c-63437a6b98ba', 'Renote target is not public or home');
}
}
@@ -317,7 +317,7 @@ export class NoteCreateService implements OnApplicationShutdown {
if (data.renote.userId !== user.id) {
const blocked = await this.userBlockingService.checkBlocked(data.renote.userId, user.id);
if (blocked) {
- throw new Error('blocked');
+ throw new IdentifiableError('b6352a84-e5cd-4b05-a26c-63437a6b98ba', 'Renote target is blocked');
}
}
}
@@ -489,10 +489,10 @@ export class NoteCreateService implements OnApplicationShutdown {
// should really not happen, but better safe than sorry
if (data.reply?.id === insert.id) {
- throw new Error('A note can\'t reply to itself');
+ throw new IdentifiableError('ea93b7c2-3d6c-4e10-946b-00d50b1a75cb', 'A note can\'t reply to itself');
}
if (data.renote?.id === insert.id) {
- throw new Error('A note can\'t renote itself');
+ throw new IdentifiableError('ea93b7c2-3d6c-4e10-946b-00d50b1a75cb', 'A note can\'t renote itself');
}
if (data.uri != null) insert.uri = data.uri;
@@ -549,8 +549,6 @@ export class NoteCreateService implements OnApplicationShutdown {
throw err;
}
- console.error(e);
-
throw e;
}
}