This repository was archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 816
Replace newTranslatableError
with UserFriendlyError
(#10440
#10440
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
ad83e63
Introduce UserFriendlyError
MadLittleMods 6c26352
Replace newTranslatableError with UserFriendlyError
MadLittleMods e515f48
Remove ITranslatableError
MadLittleMods 9b2a077
Fix up some strict lints
MadLittleMods 08be8f0
Merge branch 'develop' into madlittlemods/user-friendly-error
MadLittleMods 04084ab
Document when we/why we can remove
MadLittleMods e8f9f47
Merge branch 'develop' into madlittlemods/user-friendly-error
MadLittleMods bac5485
Update matrix-web-i18n
MadLittleMods ef2411f
Include room ID in error
MadLittleMods 05ec56a
Translate fallback error
MadLittleMods 81e9460
Translate better
MadLittleMods 5487715
Update i18n strings
MadLittleMods 89277a3
Better re-use
MadLittleMods 60addd8
Merge branch 'develop' into madlittlemods/user-friendly-error
MadLittleMods e1f8951
Merge branch 'develop' into madlittlemods/user-friendly-error
MadLittleMods 6e2b04f
Merge branch 'develop' into madlittlemods/user-friendly-error
MadLittleMods ca40d71
Minor comment fixes
MadLittleMods File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,7 @@ import { DeviceInfo } from "matrix-js-sdk/src/crypto/deviceinfo"; | |
|
||
import dis from "../../../dispatcher/dispatcher"; | ||
import Modal from "../../../Modal"; | ||
import { _t } from "../../../languageHandler"; | ||
import { _t, UserFriendlyError } from "../../../languageHandler"; | ||
import DMRoomMap from "../../../utils/DMRoomMap"; | ||
import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton"; | ||
import SdkConfig from "../../../SdkConfig"; | ||
|
@@ -448,7 +448,15 @@ export const UserOptionsSection: React.FC<{ | |
const inviter = new MultiInviter(roomId || ""); | ||
await inviter.invite([member.userId]).then(() => { | ||
if (inviter.getCompletionState(member.userId) !== "invited") { | ||
throw new Error(inviter.getErrorText(member.userId) ?? undefined); | ||
const errorStringFromInviterUtility = inviter.getErrorText(member.userId); | ||
if (errorStringFromInviterUtility) { | ||
throw new Error(errorStringFromInviterUtility); | ||
} else { | ||
throw new UserFriendlyError( | ||
`User (%(user)s) did not end up as invited to %(roomId)s but no error was given from the inviter utility`, | ||
{ user: member.userId, roomId, cause: undefined }, | ||
); | ||
} | ||
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. The remaining TS strict errors are unrelated and tracked by element-hq/element-web#24899 And there are some nits from files we didn't even change |
||
} | ||
}); | ||
} catch (err) { | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.