From e2d5c9340711d5e68a9a35e6c11a5e781fac91e8 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Sun, 13 Jan 2019 22:59:01 +0100 Subject: [PATCH] Print detailed evaluation errors --- src/module/scripting.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/module/scripting.cpp b/src/module/scripting.cpp index e7f0ba7..4e4853b 100644 --- a/src/module/scripting.cpp +++ b/src/module/scripting.cpp @@ -95,6 +95,10 @@ void scripting::initialize() { callback(event->name, arguments); } + catch (chaiscript::exception::eval_error &e) + { + printf("Failed to handle event: %s\n", e.pretty_print().data()); + } catch (std::exception& e) { printf("Failed to handle event: %s\n", e.what()); @@ -115,6 +119,10 @@ void scripting::load_scripts() const { this->chai_->eval_file(script); } + catch (chaiscript::exception::eval_error &e) + { + printf("Failed to load script %s: %s\n", script.data(), e.pretty_print().data()); + } catch (std::exception& e) { printf("Failed to load script %s: %s\n", script.data(), e.what());