diff options
author | Nicolas Noble <pixel@nobis-crew.org> | 2013-08-05 14:19:41 -0700 |
---|---|---|
committer | Nicolas Noble <pixel@nobis-crew.org> | 2013-08-05 14:19:41 -0700 |
commit | e5393e5448c239a40368f6b043ffe28ea23a64cb (patch) | |
tree | 566793d02af95cb9724a1e8b99a1d7a6698b8258 /src/Dalos-cli.cc | |
parent | 6d6e0f01dedb12a26306b18ed44ff9be05d19266 (diff) |
Don't crash Dalos if there's an error that appears while running interactive strings.
Diffstat (limited to 'src/Dalos-cli.cc')
-rw-r--r-- | src/Dalos-cli.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/Dalos-cli.cc b/src/Dalos-cli.cc index ae4806c..acc7ea3 100644 --- a/src/Dalos-cli.cc +++ b/src/Dalos-cli.cc @@ -104,6 +104,16 @@ void MainTask::Do() { LuaExecString luaExecString(line_read); luaExecString.exec(luaMainTask); - luaExecString.throwError(); + try { + luaExecString.throwError(); + } + catch (GeneralException & e) { + const char * details = e.getDetails(); + if (details) + Printer::log(M_WARNING, " %s", details); + auto trace = e.getTrace(); + for (String & str : trace) + Printer::log(M_DEBUG, "%s", str.to_charp()); + } } } |