Ignore failure when retrieving avatar change url for profile screen

We will always get Not Found for the avatar change URL if no avatar
plugin is installed or if the avatar plugin doesn't support change
URLs. Silently ignore errors on retrieving the change URL and do not
show an error.

Change-Id: I4c26bbd5c1c193625c36a3a5efccd603d9aad197
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
Edwin Kempin 2013-04-26 14:46:49 +02:00
parent 7071035a9e
commit ef8f30ac7b

View File

@ -19,11 +19,11 @@ import static com.google.gerrit.client.FormatUtil.mediumFormat;
import com.google.gerrit.client.AvatarImage;
import com.google.gerrit.client.FormatUtil;
import com.google.gerrit.client.Gerrit;
import com.google.gerrit.client.rpc.GerritCallback;
import com.google.gerrit.client.rpc.NativeString;
import com.google.gerrit.client.rpc.RestApi;
import com.google.gerrit.reviewdb.client.Account;
import com.google.gwt.i18n.client.LocaleInfo;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Anchor;
import com.google.gwt.user.client.ui.Grid;
import com.google.gwt.user.client.ui.HTMLTable.CellFormatter;
@ -96,12 +96,16 @@ public class MyProfileScreen extends SettingsScreen {
void display(final Account account) {
avatar.setAccount(FormatUtil.asInfo(account), 93, false);
new RestApi("/accounts/").id("self").view("avatar.change.url")
.get(new GerritCallback<NativeString>() {
.get(new AsyncCallback<NativeString>() {
@Override
public void onSuccess(NativeString changeUrl) {
changeAvatar.setHref(changeUrl.asString());
changeAvatar.setVisible(true);
}
@Override
public void onFailure(Throwable caught) {
}
});
int row = 0;