Narrow the «not defined» check to just ThrownError

This commit is contained in:
Chuck 2019-09-06 11:38:29 -07:00 committed by Linus Heckemann
parent c7c684aaa3
commit 0adf77e2ee

View file

@ -352,7 +352,7 @@ void printValue(Context * ctx, Out & out, std::variant<Value, std::exception_ptr
ctx->state->forceValueDeep(v);
out << v;
}
} catch (Error & e) {
} catch (ThrownError & e) {
if (e.msg() == "The option `" + path + "' is used but not defined.") {
// 93% of errors are this, and just letting this message through would be
// misleading. These values may or may not actually be "used" in the
@ -365,6 +365,8 @@ void printValue(Context * ctx, Out & out, std::variant<Value, std::exception_ptr
} else {
out << describeError(e);
}
} catch (Error & e) {
out << describeError(e);
}
}