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:
@@ -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();
|
||||
|
Reference in New Issue
Block a user