UsersService: Improve logging in getNoteByIdOrAlias

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2020-10-24 11:34:16 +02:00
parent 15db6a9b2a
commit 558addf83e
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3

View file

@ -154,10 +154,15 @@ export class NotesService {
],
});
if (note === undefined) {
this.logger.debug(
`Could not find note '${noteIdOrAlias}'`,
'getNoteByIdOrAlias',
);
throw new NotInDBError(
`Note with id/alias '${noteIdOrAlias}' not found.`,
);
}
this.logger.debug(`Found note '${noteIdOrAlias}'`, 'getNoteByIdOrAlias');
return note;
}