21template<std::derived_from<EvalError> T>
26 template<std::derived_from<EvalError> T>
27 friend class EvalErrorBuilder;
29 std::shared_ptr<const DebugTrace> frame;
35MakeError(ParseError, Error);
37MakeError(ThrownError, AssertionError);
41MakeError(MissingArgumentError,
EvalError);
42MakeError(RestrictedPathError, Error);
43MakeError(InfiniteRecursionError,
EvalError);
53 InvalidPathError(
const Path & path)
54 :
EvalError(
"path '%s' did not exist in the store during evaluation", path)
59template<std::derived_from<EvalError> T>
60class [[nodiscard]] EvalErrorBuilder final
67 template<
typename...
Args>
69 : positions(positions)
71 , error(make_box_ptr<T>(args...))
75 [[gnu::noinline]] EvalErrorBuilder<T> withExitStatus(
unsigned int exitStatus) &&;
77 [[gnu::noinline]] EvalErrorBuilder<T> atPos(
PosIdx pos) &&;
79 [[gnu::noinline]] EvalErrorBuilder<T> withTrace(
PosIdx pos,
const std::string_view text) &&;
81 [[gnu::noinline]] EvalErrorBuilder<T> withSuggestions(
Suggestions & s) &&;
83 [[gnu::noinline]] EvalErrorBuilder<T> withFrame(
const Env & e,
const Expr & ex) &&;
85 [[gnu::noinline]] EvalErrorBuilder<T> addTrace(
PosIdx pos,
HintFmt hint) &&;
87 template<
typename...
Args>
88 [[gnu::noinline]] EvalErrorBuilder<T>
89 addTrace(
PosIdx pos, std::string_view formatString,
const Args &... formatArgs) &&;
99 [[gnu::noinline, gnu::noreturn]]
void throw_() &&;
Definition eval-error.hh:61
void debugThrow(NeverAsync={}) &&
Definition eval-error.cc:70
void throw_() &&
Definition eval-error.cc:84
Definition eval-error.hh:25
Definition pos-table.hh:13
Definition suggestions.hh:29
This file defines two main structs/classes used in nix error handling.
Definition nixexpr.hh:104
std::string Path
Definition types.hh:28