diff options
author | Marcus Fritzsch <marcus_fritzsch@mentor.com> | 2017-08-01 16:05:29 +0200 |
---|---|---|
committer | Marcus Fritzsch <marcus_fritzsch@mentor.com> | 2017-08-08 17:24:00 +0200 |
commit | d16426164142cdddeaf16cb18a6ac5f191c8e0e4 (patch) | |
tree | b245a945337589b3fee2db5efe85f633216e5724 /src | |
parent | 75524b385a2b3adaa5feabf547b80d412f3a1c56 (diff) |
app: when loading config, handle returned errors
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/app.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/app.cpp b/src/app.cpp index 353557e..461ac35 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -113,19 +113,27 @@ App::App(wl::display *d) display{d}, controller{}, outputs(), - layouts(), // load_layout("../layout.json").unwrap()), - surface2layer(load_layer_ids("../ids.json").unwrap()) { - // layouts(load_layout("../layout.json").unwrap()) { + layouts(), + surface2layer() { assert(g_app == nullptr); g_app = this; - try { + { + auto l = load_layer_ids("../ids.json"); + if (l.is_ok()) { + this->surface2layer = l.unwrap(); + } else { + logerror("%s", l.err().value()); + } + } + + { auto l = load_layout("../layout.json"); - if (l.is_err()) { - logerror("Coult not load layout configuration: %s", l.err().value()); + if (l.is_ok()) { + this->layouts = l.unwrap(); + } else { + logerror("%s", l.err().value()); } - } catch (std::exception &e) { - logerror("Coult not load layout configuration: %s", e.what()); } } |