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

Log errors in english #8508

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/AddThreepid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default class AddThreepid {
return res;
}, function(err) {
if (err.errcode === 'M_THREEPID_IN_USE') {
err.message = _t('This email address is already in use');
err.message = 'This email address is already in use';
} else if (err.httpStatus) {
err.message = err.message + ` (Status ${err.httpStatus})`;
}
Expand Down Expand Up @@ -91,7 +91,7 @@ export default class AddThreepid {
return res;
}, function(err) {
if (err.errcode === 'M_THREEPID_IN_USE') {
err.message = _t('This email address is already in use');
err.message = 'This email address is already in use';
} else if (err.httpStatus) {
err.message = err.message + ` (Status ${err.httpStatus})`;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/dialogs/SetEmailDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default class SetEmailDialog extends React.Component<IProps, IState> {
logger.error("Unable to add email address " + emailAddress + " " + err);
Modal.createTrackedDialog('Unable to add email address', '', ErrorDialog, {
title: _t("Unable to add email address"),
description: ((err && err.message) ? err.message : _t("Operation failed")),
description: ((err && err.message) ? _t(err.message) : _t("Operation failed")),
});
});
this.setState({ emailBusy: true });
Expand Down
4 changes: 2 additions & 2 deletions src/components/views/settings/ChangePassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,11 @@ export default class ChangePassword extends React.Component<IProps, IState> {
private checkPassword(oldPass: string, newPass: string, confirmPass: string): {error: string} {
if (newPass !== confirmPass) {
return {
error: _t("New passwords don't match"),
error: "New passwords don't match",
};
} else if (!newPass || newPass.length === 0) {
return {
error: _t("Passwords can't be empty"),
error: "Passwords can't be empty",
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,14 +249,14 @@ export default class GeneralUserSettingsTab extends React.Component<IProps, ISta
// TODO: Figure out a design that doesn't involve replacing the current dialog
let errMsg = err.error || err.message || "";
if (err.httpStatus === 403) {
errMsg = _t("Failed to change password. Is your password correct?");
errMsg = "Failed to change password. Is your password correct?";
} else if (!errMsg) {
errMsg += ` (HTTP status ${err.httpStatus})`;
}
logger.error("Failed to change password: " + errMsg);
Modal.createTrackedDialog('Failed to change password', '', ErrorDialog, {
title: _t("Error"),
description: errMsg,
description: _t(errMsg),
});
};

Expand Down