summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-08-01 12:19:14 +0200
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-08-08 17:24:00 +0200
commitc03004341a31971fcc926675a6ba306867721e15 (patch)
treea2f9a9c32a7f63b8833a7401fe150a6e0cffbb0c /src
parent9642c1098a3b3326c2213b5f791dfa84c6352625 (diff)
app: handle failure to load layout.json gracefully
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
Diffstat (limited to 'src')
-rw-r--r--src/app.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/app.cpp b/src/app.cpp
index 5ddcb8c..0bf4529 100644
--- a/src/app.cpp
+++ b/src/app.cpp
@@ -99,11 +99,20 @@ App::App(wl::display *d)
display{d},
controller{},
outputs(),
- layouts(load_layout("../layout.json").unwrap()),
+ layouts(), //load_layout("../layout.json").unwrap()),
surface2layer(load_layer_ids("../ids.json").unwrap()) {
// layouts(load_layout("../layout.json").unwrap()) {
assert(g_app == nullptr);
g_app = this;
+
+ try {
+ auto l = load_layout("../layout.json");
+ if (l.is_err()) {
+ logerror("Coult not load layout configuration: %s", l.err().value());
+ }
+ } catch (std::exception &e) {
+ logerror("Coult not load layout configuration: %s", e.what());
+ }
}
App::~App() { g_app = nullptr; }