aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/primops/fetchTree.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-06-15 14:06:58 +0200
committerEelco Dolstra <edolstra@gmail.com>2020-06-15 14:06:58 +0200
commit1fb762d11fadc659ef41b79eaddddcce5fbbc192 (patch)
treee47612705a9af354ab5bdca7864d70b1158ace12 /src/libexpr/primops/fetchTree.cc
parentfd64e4fb96f814440dc337ce664cdbd22e0eabb2 (diff)
Get rid of explicit ErrorInfo constructors
Diffstat (limited to 'src/libexpr/primops/fetchTree.cc')
-rw-r--r--src/libexpr/primops/fetchTree.cc28
1 files changed, 12 insertions, 16 deletions
diff --git a/src/libexpr/primops/fetchTree.cc b/src/libexpr/primops/fetchTree.cc
index 62bc4f433..9be93710a 100644
--- a/src/libexpr/primops/fetchTree.cc
+++ b/src/libexpr/primops/fetchTree.cc
@@ -66,11 +66,10 @@ static void prim_fetchTree(EvalState & state, const Pos & pos, Value * * args, V
}
if (!attrs.count("type"))
- throw Error(
- ErrorInfo {
- .hint = hintfmt("attribute 'type' is missing in call to 'fetchTree'"),
- .nixCode = NixCode { .errPos = pos }
- });
+ throw Error({
+ .hint = hintfmt("attribute 'type' is missing in call to 'fetchTree'"),
+ .nixCode = NixCode { .errPos = pos }
+ });
input = fetchers::inputFromAttrs(attrs);
} else
@@ -111,20 +110,17 @@ static void fetch(EvalState & state, const Pos & pos, Value * * args, Value & v,
else if (n == "name")
name = state.forceStringNoCtx(*attr.value, *attr.pos);
else
- throw EvalError(
- ErrorInfo {
- .hint = hintfmt("unsupported argument '%s' to '%s'",
- attr.name, who),
- .nixCode = NixCode { .errPos = *attr.pos }
- });
+ throw EvalError({
+ .hint = hintfmt("unsupported argument '%s' to '%s'", attr.name, who),
+ .nixCode = NixCode { .errPos = *attr.pos }
+ });
}
if (!url)
- throw EvalError(
- ErrorInfo {
- .hint = hintfmt("'url' argument required"),
- .nixCode = NixCode { .errPos = pos }
- });
+ throw EvalError({
+ .hint = hintfmt("'url' argument required"),
+ .nixCode = NixCode { .errPos = pos }
+ });
} else
url = state.forceStringNoCtx(*args[0], pos);