-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more logging to attendance command #195
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -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"; | ||||||
|
@@ -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); | ||||||
|
@@ -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}: ${error.toString()}`) | ||||||
H-Shay marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
} | ||||||
} | ||||||
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}: ${error.toString()}`) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Gives you a nice stacktrack
This feature is not used nearly enough https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Error#cause There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cool thanks for the insight - I am new to typescript/javascript so appreciate the tips :) |
||||||
} | ||||||
} | ||||||
html += "</ul>"; | ||||||
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a drive-by cleanup - the import was unused.