Phase 441: surface voice/stage connect permission errors to UI.
Return IPC error toasts for no-permission and listen-only join failures on join-voice, join-voice-listen, and join-stage handlers. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -514,8 +514,13 @@ async function dispatchUiMessage (platform, msg, hooks = {}) {
|
||||
await platform.joinStageChannel(msg.channelId)
|
||||
pushState()
|
||||
} catch (err) {
|
||||
if (/voice channel is full/i.test(err?.message || '')) {
|
||||
send({ type: 'error', message: err.message })
|
||||
const errMsg = err?.message || String(err)
|
||||
if (/voice channel is full/i.test(errMsg)) {
|
||||
send({ type: 'error', message: errMsg })
|
||||
return true
|
||||
}
|
||||
if (/no permission to connect/i.test(errMsg)) {
|
||||
send({ type: 'error', message: errMsg })
|
||||
return true
|
||||
}
|
||||
throw err
|
||||
@@ -563,8 +568,13 @@ async function dispatchUiMessage (platform, msg, hooks = {}) {
|
||||
await platform.joinVoiceChannel(msg.channelId)
|
||||
pushState()
|
||||
} catch (err) {
|
||||
if (/voice channel is full/i.test(err?.message || '')) {
|
||||
send({ type: 'error', message: err.message })
|
||||
const errMsg = err?.message || String(err)
|
||||
if (/voice channel is full/i.test(errMsg)) {
|
||||
send({ type: 'error', message: errMsg })
|
||||
return true
|
||||
}
|
||||
if (/no permission to connect|cannot join voice listen-only/i.test(errMsg)) {
|
||||
send({ type: 'error', message: errMsg })
|
||||
return true
|
||||
}
|
||||
throw err
|
||||
@@ -576,8 +586,13 @@ async function dispatchUiMessage (platform, msg, hooks = {}) {
|
||||
await platform.joinVoiceListenOnly(msg.channelId)
|
||||
pushState()
|
||||
} catch (err) {
|
||||
if (/voice channel is full/i.test(err?.message || '')) {
|
||||
send({ type: 'error', message: err.message })
|
||||
const errMsg = err?.message || String(err)
|
||||
if (/voice channel is full/i.test(errMsg)) {
|
||||
send({ type: 'error', message: errMsg })
|
||||
return true
|
||||
}
|
||||
if (/no permission to connect|cannot join voice listen-only/i.test(errMsg)) {
|
||||
send({ type: 'error', message: errMsg })
|
||||
return true
|
||||
}
|
||||
throw err
|
||||
|
||||
Reference in New Issue
Block a user