[mastodon-client] Return error messages for error types without a .message property

This commit is contained in:
Laura Hausmann 2023-10-07 14:30:43 +02:00
parent c8415a5223
commit 99de127376
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -41,7 +41,7 @@ export async function CatchErrorsMiddleware(ctx: MastoContext, next: () => Promi
}
ctx.status = 500;
}
ctx.body = { error: e.message };
ctx.body = { error: e.message ?? e };
return;
}
}