[mastodon-client] Fix getNoteOr404

This commit is contained in:
Laura Hausmann 2023-10-06 03:26:04 +02:00
parent afd9e236a3
commit 153c08fae1
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -388,9 +388,8 @@ export class NoteHelpers {
}
public static async getNoteOr404(id: string, user: ILocalUser | null): Promise<Note> {
return getNote(id, user).then(p => {
if (p === null) throw new MastoApiError(404);
return p;
return getNote(id, user).catch(_ => {
throw new MastoApiError(404);
});
}