Add "please try invite" message when joinRoom in /api/link-space fails

This commit is contained in:
Elliu 2025-08-31 20:11:07 +09:00
parent ecb4ae0315
commit f6c749acca

View file

@ -96,6 +96,9 @@ as.router.post("/api/link-space", defineEventHandler(async event => {
try {
await api.joinRoom(parsedBody.space_id, null, via)
} catch (e) {
if (via.join("") == "") {
throw createError({status: 403, message: "Unable To Join", data: `Unable to join the requested Matrix space. Please invite the bridge to the space and try again. (Server said: ${e.errcode} - ${e.message})`})
}
throw createError({status: 403, message: e.errcode, data: `${e.errcode} - ${e.message}`})
}