You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-11 20:22:36 +03:00
Make slash command errors translatable but also work in rageshakes (#7377)
See https://github.com/matrix-org/matrix-react-sdk/pull/7372#discussion_r769556546 We want the error to be translated for the user but not in our rageshake logs. Also updates some error messages to give more info.
This commit is contained in:
@@ -53,9 +53,9 @@ interface ITranslatableError extends Error {
|
||||
* @param {string} message Message to translate.
|
||||
* @returns {Error} The constructed error.
|
||||
*/
|
||||
export function newTranslatableError(message: string) {
|
||||
export function newTranslatableError(message: string, variables?: IVariables): ITranslatableError {
|
||||
const error = new Error(message) as ITranslatableError;
|
||||
error.translatedMessage = _t(message);
|
||||
error.translatedMessage = _t(message, variables);
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user