diff --git a/src/api/public/notes/notes.controller.ts b/src/api/public/notes/notes.controller.ts index 923ecd15b..ecb2c65b7 100644 --- a/src/api/public/notes/notes.controller.ts +++ b/src/api/public/notes/notes.controller.ts @@ -226,17 +226,10 @@ export class NotesController { @RequestUser() user: User, @Param('noteIdOrAlias', GetNotePipe) note: Note, ): Promise { - try { - if (!this.permissionsService.mayRead(user, note)) { - throw new UnauthorizedException('Reading note denied!'); - } - return await this.noteService.toNoteMetadataDto(note); - } catch (e) { - if (e instanceof PermissionsUpdateInconsistentError) { - throw new BadRequestException(e.message); - } - throw e; + if (!this.permissionsService.mayRead(user, note)) { + throw new UnauthorizedException('Reading note denied!'); } + return await this.noteService.toNoteMetadataDto(note); } @UseGuards(TokenAuthGuard)