Revision: 7257
Author: [email protected]
Date: Fri Dec  4 14:17:43 2009
Log: Log extra information when AsyncFragmentLoader
sees an HTTP download failure.

Review by: fabbott

http://code.google.com/p/google-web-toolkit/source/detail?r=7257

Modified:
  /trunk/user/src/com/google/gwt/core/client/impl/AsyncFragmentLoader.java

=======================================
---  
/trunk/user/src/com/google/gwt/core/client/impl/AsyncFragmentLoader.java        
 
Wed Nov 18 11:30:09 2009
+++  
/trunk/user/src/com/google/gwt/core/client/impl/AsyncFragmentLoader.java        
 
Fri Dec  4 14:17:43 2009
@@ -155,8 +155,9 @@
    private static class HttpDownloadFailure extends RuntimeException {
      private final int statusCode;

-    public HttpDownloadFailure(int statusCode) {
-      super("HTTP download failed with status " + statusCode);
+    public HttpDownloadFailure(String url, int statusCode, String  
statusText) {
+      super("Download of " + url + " failed with status " + statusCode  
+ "("
+          + statusText + ")");
        this.statusCode = statusCode;
      }

@@ -263,7 +264,7 @@
    private static class XhrLoadingStrategy implements LoadingStrategy {
      public void startLoadingFragment(int fragment,
          final LoadErrorHandler loadErrorHandler) {
-      String fragmentUrl = gwtStartLoadingFragment(fragment,  
loadErrorHandler);
+      final String fragmentUrl = gwtStartLoadingFragment(fragment,  
loadErrorHandler);

        if (fragmentUrl == null) {
          // The download has already started; nothing more to do
@@ -289,8 +290,8 @@
                  loadErrorHandler.loadFailed(e);
                }
              } else {
-              loadErrorHandler.loadFailed(new HttpDownloadFailure(
-                  xhr.getStatus()));
+              loadErrorHandler.loadFailed(new  
HttpDownloadFailure(fragmentUrl,
+                  xhr.getStatus(), xhr.getStatusText()));
              }
            }
          }

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to