forked from cadence/out-of-your-element
Add "please try invite" message when joinRoom in /api/link-space fails
This commit is contained in:
parent
ecb4ae0315
commit
f6c749acca
1 changed files with 3 additions and 0 deletions
|
@ -96,6 +96,9 @@ as.router.post("/api/link-space", defineEventHandler(async event => {
|
||||||
try {
|
try {
|
||||||
await api.joinRoom(parsedBody.space_id, null, via)
|
await api.joinRoom(parsedBody.space_id, null, via)
|
||||||
} catch (e) {
|
} 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}`})
|
throw createError({status: 403, message: e.errcode, data: `${e.errcode} - ${e.message}`})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue