mirror of
https://github.com/NixOS/nix
synced 2025-06-25 06:31:14 +02:00
trying debugThrow
This commit is contained in:
parent
99d69ac23f
commit
2c9fafdc9e
7 changed files with 115 additions and 207 deletions
|
@ -556,8 +556,7 @@ std::string AttrCursor::getString()
|
|||
} else
|
||||
{
|
||||
auto e = TypeError("'%s' is not a string", getAttrPathStr());
|
||||
root->state.debugLastTrace(e);
|
||||
throw e;
|
||||
root->state.debugThrowLastTrace(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -567,8 +566,7 @@ std::string AttrCursor::getString()
|
|||
if (v.type() != nString && v.type() != nPath)
|
||||
{
|
||||
auto e = TypeError("'%s' is not a string but %s", getAttrPathStr(), showType(v.type()));
|
||||
root->state.debugLastTrace(e);
|
||||
throw e;
|
||||
root->state.debugThrowLastTrace(e);
|
||||
}
|
||||
|
||||
return v.type() == nString ? v.string.s : v.path;
|
||||
|
@ -595,8 +593,7 @@ string_t AttrCursor::getStringWithContext()
|
|||
} else
|
||||
{
|
||||
auto e = TypeError("'%s' is not a string", getAttrPathStr());
|
||||
root->state.debugLastTrace(e);
|
||||
throw e;
|
||||
root->state.debugThrowLastTrace(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -610,9 +607,7 @@ string_t AttrCursor::getStringWithContext()
|
|||
else
|
||||
{
|
||||
auto e = TypeError("'%s' is not a string but %s", getAttrPathStr(), showType(v.type()));
|
||||
root->state.debugLastTrace(e);
|
||||
throw e;
|
||||
return {v.path, {}}; // should never execute
|
||||
root->state.debugThrowLastTrace(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -628,8 +623,7 @@ bool AttrCursor::getBool()
|
|||
} else
|
||||
{
|
||||
auto e = TypeError("'%s' is not a Boolean", getAttrPathStr());
|
||||
root->state.debugLastTrace(e);
|
||||
throw e;
|
||||
root->state.debugThrowLastTrace(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -639,8 +633,7 @@ bool AttrCursor::getBool()
|
|||
if (v.type() != nBool)
|
||||
{
|
||||
auto e = TypeError("'%s' is not a Boolean", getAttrPathStr());
|
||||
root->state.debugLastTrace(e);
|
||||
throw e;
|
||||
root->state.debugThrowLastTrace(e);
|
||||
}
|
||||
|
||||
return v.boolean;
|
||||
|
@ -691,8 +684,7 @@ std::vector<Symbol> AttrCursor::getAttrs()
|
|||
} else
|
||||
{
|
||||
auto e = TypeError("'%s' is not an attribute set", getAttrPathStr());
|
||||
root->state.debugLastTrace(e);
|
||||
throw e;
|
||||
root->state.debugThrowLastTrace(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -702,8 +694,7 @@ std::vector<Symbol> AttrCursor::getAttrs()
|
|||
if (v.type() != nAttrs)
|
||||
{
|
||||
auto e = TypeError("'%s' is not an attribute set", getAttrPathStr());
|
||||
root->state.debugLastTrace(e);
|
||||
throw e;
|
||||
root->state.debugThrowLastTrace(e);
|
||||
}
|
||||
|
||||
std::vector<Symbol> attrs;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue