Skip to content

Commit b0f0900

Browse files
committed
MOBILE-3833 bbb: Improve error message when user not in group
1 parent b398b08 commit b0f0900

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

scripts/langindex.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,7 @@
461461
"addon.mod_bigbluebuttonbn.view_message_session_started_at": "bigbluebuttonbn",
462462
"addon.mod_bigbluebuttonbn.view_message_viewer": "bigbluebuttonbn",
463463
"addon.mod_bigbluebuttonbn.view_message_viewers": "bigbluebuttonbn",
464+
"addon.mod_bigbluebuttonbn.view_nojoin": "bigbluebuttonbn",
464465
"addon.mod_book.errorchapter": "book",
465466
"addon.mod_book.modulenameplural": "book",
466467
"addon.mod_book.navnexttitle": "book",

src/addons/mod/bigbluebuttonbn/components/index/index.ts

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,23 @@ export class AddonModBBBIndexComponent extends CoreCourseModuleMainActivityCompo
8181
return;
8282
}
8383

84-
this.meetingInfo = await AddonModBBB.getMeetingInfo(this.bbb.id, this.groupId, {
85-
cmId: this.module.id,
86-
});
87-
88-
if (this.meetingInfo.statusrunning && this.meetingInfo.userlimit > 0) {
89-
const count = (this.meetingInfo.participantcount || 0) + (this.meetingInfo.moderatorcount || 0);
90-
if (count === this.meetingInfo.userlimit) {
91-
this.meetingInfo.statusmessage = Translate.instant('addon.mod_bigbluebuttonbn.userlimitreached');
84+
try {
85+
this.meetingInfo = await AddonModBBB.getMeetingInfo(this.bbb.id, this.groupId, {
86+
cmId: this.module.id,
87+
});
88+
89+
if (this.meetingInfo.statusrunning && this.meetingInfo.userlimit > 0) {
90+
const count = (this.meetingInfo.participantcount || 0) + (this.meetingInfo.moderatorcount || 0);
91+
if (count === this.meetingInfo.userlimit) {
92+
this.meetingInfo.statusmessage = Translate.instant('addon.mod_bigbluebuttonbn.userlimitreached');
93+
}
9294
}
95+
} catch (error) {
96+
if (error && error.errorcode === 'restrictedcontextexception') {
97+
error.message = Translate.instant('addon.mod_bigbluebuttonbn.view_nojoin');
98+
}
99+
100+
throw error;
93101
}
94102
}
95103

src/addons/mod/bigbluebuttonbn/lang.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
"view_message_moderators": "moderators",
1515
"view_message_session_started_at": "This session started at",
1616
"view_message_viewer": "viewer",
17-
"view_message_viewers": "viewers"
17+
"view_message_viewers": "viewers",
18+
"view_nojoin": "You do not have a role that is allowed to join this session."
1819
}

0 commit comments

Comments
 (0)