Improve error message when JS plugin fails to load.

Previous implementation was showing misleading error message when plugin
was removed by hand from server. Now message is more informative.

Change-Id: Id18fd995033f9c2f8dae22f054308d17fa05e04d
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
This commit is contained in:
Dariusz Luksza
2013-05-09 21:09:59 +02:00
parent 0b7e7850e5
commit 3787f5eec2
3 changed files with 9 additions and 2 deletions

View File

@@ -44,6 +44,7 @@ import com.google.gerrit.reviewdb.client.AuthType;
import com.google.gerrit.reviewdb.client.Project;
import com.google.gwt.aria.client.Roles;
import com.google.gwt.core.client.Callback;
import com.google.gwt.core.client.CodeDownloadException;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.JavaScriptObject;
@@ -608,8 +609,12 @@ public class Gerrit implements EntryPoint {
@Override
public void onFailure(Exception reason) {
ErrorDialog d = new ErrorDialog(reason);
d.setTitle(M.pluginFailed(url));
ErrorDialog d;
if (reason instanceof CodeDownloadException) {
d = new ErrorDialog(M.cannotDownloadPlugin(url));
} else {
d = new ErrorDialog(M.pluginFailed(url));
}
d.center();
}
}).inject();