Index: chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_manager.js |
diff --git a/chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_manager.js b/chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_manager.js |
index 7c2040cddfc743df4adf768e2dea57cc142bf04e..51855ae975bbc6437bcfa2aef8d1706c98f2f2b9 100644 |
--- a/chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_manager.js |
+++ b/chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_manager.js |
@@ -84,21 +84,26 @@ function WallpaperManager(dialogDom) { |
var xhr = new XMLHttpRequest(); |
var locale = navigator.language; |
xhr.open('GET', ManifestBaseURL + locale + '.json', false); |
- xhr.send(null); |
- // TODO(bshe): We should save the downloaded manifest to local disk. Other |
- // components may want to use it (i.e. screen saver). |
- if (xhr.status === 200) { |
- this.parseManifest_(xhr.responseText); |
- } else { |
- // Fall back to en locale if current locale is not supported. |
- xhr.open('GET', ManifestBaseURL + 'en.json', false); |
+ try { |
xhr.send(null); |
+ // TODO(bshe): We should save the downloaded manifest to local disk. Other |
+ // components may want to use it (i.e. screen saver). |
if (xhr.status === 200) { |
this.parseManifest_(xhr.responseText); |
} else { |
- this.manifest_ = {}; |
- this.butterBar_.showError_(str('connectionFailed')); |
+ // Fall back to en locale if current locale is not supported. |
+ xhr.open('GET', ManifestBaseURL + 'en.json', false); |
+ xhr.send(null); |
+ if (xhr.status === 200) { |
+ this.parseManifest_(xhr.responseText); |
flackr
2012/10/16 15:29:48
This nested structure which does the same thing to
bshe
2012/10/16 16:01:48
Done.
On 2012/10/16 15:29:48, flackr wrote:
|
+ } else { |
+ this.manifest_ = {}; |
+ this.butterBar_.showError_(str('connectionFailed')); |
+ } |
} |
+ } catch (e) { |
+ this.manifest_ = {}; |
+ this.butterBar_.showError_(str('connectionFailed')); |
} |
// TODO(bshe): Fall back to saved manifest if there is a problem fetching |