File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
WordPress/src/main/java/org/wordpress/android/ui/prefs Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -286,7 +286,13 @@ public void onAccountChanged(OnAccountChanged event) {
286286 showChangePasswordProgressDialog (false );
287287
288288 if (event .isError ()) {
289- ToastUtils .showToast (getActivity (), event .error .message , ToastUtils .Duration .LONG );
289+ // We usually rely on event.error.type and provide our own localized message.
290+ // This case is exceptional because:
291+ // 1. The server-side error type is generic, but patching this server-side is quite involved
292+ // 2. We know the error string return from the server has decent localization
293+ String errorMessage = !TextUtils .isEmpty (event .error .message ) ? event .error .message
294+ : getString (R .string .error_post_account_settings );
295+ ToastUtils .showToast (getActivity (), errorMessage , ToastUtils .Duration .LONG );
290296 AppLog .e (T .SETTINGS , event .error .message );
291297 } else {
292298 ToastUtils .showToast (getActivity (), R .string .change_password_confirmation , ToastUtils .Duration .LONG );
You can’t perform that action at this time.
0 commit comments