aboutsummaryrefslogtreecommitdiff
path: root/src/libcmd/command.cc
diff options
context:
space:
mode:
authorBen Burdette <bburdette@gmail.com>2022-01-08 11:03:48 -0700
committerBen Burdette <bburdette@gmail.com>2022-01-08 11:03:48 -0700
commita963674d88f2f1af6181f126ed4288ec65b61fc6 (patch)
treeff9f0c5b4aa339f946181724a2cdfa0bc2d04488 /src/libcmd/command.cc
parentc51b527c280ee08b3ce3ca6d229139c4292b3176 (diff)
optinoal error; compiles
Diffstat (limited to 'src/libcmd/command.cc')
-rw-r--r--src/libcmd/command.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libcmd/command.cc b/src/libcmd/command.cc
index 252bc1fad..ed8f6d295 100644
--- a/src/libcmd/command.cc
+++ b/src/libcmd/command.cc
@@ -63,7 +63,7 @@ EvalCommand::EvalCommand()
});
}
-extern std::function<void(const Error & error, const Env & env, const Expr & expr)> debuggerHook;
+extern std::function<void(const Error * error, const Env & env, const Expr & expr)> debuggerHook;
ref<EvalState> EvalCommand::getEvalState()
{
@@ -76,13 +76,14 @@ ref<EvalState> EvalCommand::getEvalState()
#endif
searchPath, getEvalStore(), getStore());
if (startReplOnEvalErrors)
- debuggerHook = [evalState{ref<EvalState>(evalState)}](const Error & error, const Env & env, const Expr & expr) {
- printError("%s\n\n" ANSI_BOLD "Starting REPL to allow you to inspect the current state of the evaluator.\n" ANSI_NORMAL, error.what());
+ debuggerHook = [evalState{ref<EvalState>(evalState)}](const Error * error, const Env & env, const Expr & expr) {
+ if (error)
+ printError("%s\n\n" ANSI_BOLD "Starting REPL to allow you to inspect the current state of the evaluator.\n" ANSI_NORMAL, error->what());
if (expr.staticenv)
{
auto vm = mapStaticEnvBindings(*expr.staticenv.get(), env);
- runRepl(evalState, &error, expr, *vm);
+ runRepl(evalState, error, expr, *vm);
}
};
}