Skip to content

Commit

Permalink
Add more logging to attendance command (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
H-Shay authored Nov 8, 2023
1 parent df52489 commit 4d8770b
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/commands/AttendanceCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ limitations under the License.
*/

import { ICommand } from "./ICommand";
import { MatrixClient } from "matrix-bot-sdk";
import { Conference } from "../Conference";
import { resolveIdentifiers } from "../invites";
import { COLOR_GREEN, COLOR_RED } from "../models/colors";
Expand Down Expand Up @@ -67,7 +66,7 @@ export class AttendanceCommand implements ICommand {

if (bsRoomId) {
if (!bsPeople) {
throw new Error("bsRoomId set but bsPeople isn't!");
throw new Error(`the auditorium ${name} has a backstage room id but no backstage people set!`);
}
const bsInviteTargets = await resolveIdentifiers(this.client, bsPeople);
const bsJoinedMembers = await this.client.getJoinedRoomMembers(bsRoomId);
Expand All @@ -90,12 +89,22 @@ export class AttendanceCommand implements ICommand {
const bs = this.conference.getAuditoriumBackstage(await auditorium.getId());
const inviteTargets = await this.conference.getInviteTargetsForAuditorium(auditorium);
const bsInviteTargets = await this.conference.getInviteTargetsForAuditorium(auditorium, true);
await append(inviteTargets, bsInviteTargets, await auditorium.getId(), auditorium.roomId, bs.roomId, doAppend);
try {
await append(inviteTargets, bsInviteTargets, await auditorium.getId(), auditorium.roomId, bs.roomId, doAppend);
}
catch (error) {
throw new Error(`Error calculating invite acceptance in auditorium ${auditorium}`, {cause: error})
}
}
for (const spiRoom of this.conference.storedInterestRooms) {
const doAppend = !!targetAudId && (targetAudId === "all" || targetAudId === await spiRoom.getId());
const inviteTargets = await this.conference.getInviteTargetsForInterest(spiRoom);
await append(inviteTargets, null, await spiRoom.getId(), spiRoom.roomId, null, doAppend);
try {
await append(inviteTargets, null, await spiRoom.getId(), spiRoom.roomId, null, doAppend);
}
catch (error) {
throw new Error(`Error calculating invite acceptance in special interest room ${spiRoom}`, {cause:error})
}
}
html += "</ul>";

Expand Down

0 comments on commit 4d8770b

Please sign in to comment.