Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Conversation

t3chguy
Copy link
Member

@t3chguy t3chguy commented Mar 24, 2023

For element-hq/element-web#21967


This change is marked as an internal change (Task), so will not be included in the changelog.

@t3chguy t3chguy added the T-Task Refactoring, enabling or disabling functionality, other engineering tasks label Mar 24, 2023
@t3chguy t3chguy marked this pull request as ready for review March 24, 2023 12:08
@t3chguy t3chguy requested a review from a team as a code owner March 24, 2023 12:08
Copy link
Member

@andybalaam andybalaam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thank you!

@t3chguy t3chguy changed the title Conform more code to strictNullChecks Conform more code to strictNullChecks (#10444 Mar 27, 2023
@t3chguy t3chguy merged commit c225b8e into develop Mar 27, 2023
@t3chguy t3chguy deleted the t3chguy/tsc-strct11 branch March 27, 2023 07:01
await inviter.invite([member.userId]).then(() => {
if (inviter.getCompletionState(member.userId) !== "invited") {
throw new Error(inviter.getErrorText(member.userId));
throw new Error(inviter.getErrorText(member.userId) ?? undefined);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new Error(undefined) isn't very useful.

In #10440, I've updated this to fallback to a better error message,

Suggested change
throw new Error(inviter.getErrorText(member.userId) ?? undefined);
throw new Error(
inviter.getErrorText(member.userId) ||
`User (${member.userId}) did not end up as invited but no error was given from the inviter utility`,
);

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

T-Task Refactoring, enabling or disabling functionality, other engineering tasks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants