libexpr: Throw the correct error in toJSON
BaseError::addTrace(...) returns a BaseError, but we want to throw a TypeError instead. Fixes #6336.
This commit is contained in:
parent
22522722a6
commit
fa83b865a2
|
@ -84,7 +84,8 @@ void printValueAsJSON(EvalState & state, bool strict,
|
|||
.msg = hintfmt("cannot convert %1% to JSON", showType(v)),
|
||||
.errPos = v.determinePos(pos)
|
||||
});
|
||||
throw e.addTrace(pos, hintfmt("message for the trace"));
|
||||
e.addTrace(pos, hintfmt("message for the trace"));
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue