diff options
author | Will Greenberg <ifnspifn@gmail.com> | 2014-02-05 18:09:58 -0800 |
---|---|---|
committer | Will Greenberg <ifnspifn@gmail.com> | 2014-02-05 18:09:58 -0800 |
commit | 814eb6c94cda7140446d76a986fe46d8f9ffc1af (patch) | |
tree | d7f9e1f161be04f03f8d8740fd2347543f546131 | |
parent | 04879b36e2f31d210d554551a71cecbc1a678c20 (diff) | |
parent | e0705284e07d21863adcf64cbb0462e527cf3060 (diff) |
Merge pull request #554 from endlessm/issues/548
Abort wiki app if json for personality not found
-rw-r--r-- | wikipedia/presenters/domain_wiki_presenter.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/wikipedia/presenters/domain_wiki_presenter.js b/wikipedia/presenters/domain_wiki_presenter.js index 764bb17..736158d 100644 --- a/wikipedia/presenters/domain_wiki_presenter.js +++ b/wikipedia/presenters/domain_wiki_presenter.js @@ -1,6 +1,7 @@ const Endless = imports.gi.Endless; const Lang = imports.lang; const GObject = imports.gi.GObject; +const System = imports.system; //Local Libraries const Utils = imports.wikipedia.utils; @@ -67,8 +68,17 @@ const DomainWikiPresenter = new Lang.Class({ }, initAppInfoFromJsonFile: function(filename) { - let app_content = JSON.parse(Utils.load_file_from_resource(filename)); - this._model.loadFromJson(app_content); + try { + let app_content = JSON.parse(Utils.load_file_from_resource(filename)); + this._model.loadFromJson(app_content); + } catch(e) { + print(e); + if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.NOT_FOUND)) { + print("****** This app does not support the personality", + Endless.get_system_personality(), "******"); + } + System.exit(1); + } }, // Respond to the front page's 'category-clicked' signal by loading the |