Revision: 7112 Author: rda...@google.com Date: Mon Nov 23 09:03:48 2009 Log: Improved error handling of failure to connect to remote UI.
Review by: mmendez http://code.google.com/p/google-web-toolkit/source/detail?r=7112 Modified: /trunk/dev/core/src/com/google/gwt/dev/DevModeBase.java ======================================= --- /trunk/dev/core/src/com/google/gwt/dev/DevModeBase.java Fri Nov 20 09:15:40 2009 +++ /trunk/dev/core/src/com/google/gwt/dev/DevModeBase.java Mon Nov 23 09:03:48 2009 @@ -311,7 +311,7 @@ public String[] getTagArgs() { return new String[] {"port-number:client-id-string | host-string:port-number:client-id-string"}; } - + @Override public boolean isUndocumented() { return true; @@ -575,8 +575,7 @@ private static final AtomicLong uniqueId = new AtomicLong(); - public static String normalizeURL(String unknownUrlText, int port, - String host) { + public static String normalizeURL(String unknownUrlText, int port, String host) { if (unknownUrlText.indexOf(":") != -1) { // Assume it's a full url. return unknownUrlText; @@ -993,10 +992,16 @@ newUI = new HeadlessUI(options); } else { if (options.useRemoteUI()) { - newUI = new RemoteUI(options.getRemoteUIHost(), - options.getRemoteUIHostPort(), options.getClientId(), - options.getPort(), options.getCodeServerPort()); - baseLogLevelForUI = TreeLogger.Type.TRACE; + try { + newUI = new RemoteUI(options.getRemoteUIHost(), + options.getRemoteUIHostPort(), options.getClientId(), + options.getPort(), options.getCodeServerPort()); + baseLogLevelForUI = TreeLogger.Type.TRACE; + } catch (Throwable t) { + System.err.println("Could not connect to remote UI listening at " + + options.getRemoteUIHost() + ":" + options.getRemoteUIHostPort() + + ". Using default UI instead."); + } } } -- http://groups.google.com/group/Google-Web-Toolkit-Contributors