mirror of
https://github.com/NixOS/nix
synced 2025-06-25 14:51:16 +02:00
Merge remote-tracking branch 'origin/master' into coerce-string
This commit is contained in:
commit
e93b59fbc5
170 changed files with 4010 additions and 2203 deletions
|
@ -87,11 +87,7 @@ struct ErrPos {
|
|||
origin = pos.origin;
|
||||
line = pos.line;
|
||||
column = pos.column;
|
||||
// is file symbol null?
|
||||
if (pos.file.set())
|
||||
file = pos.file;
|
||||
else
|
||||
file = "";
|
||||
file = pos.file;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@ -109,7 +105,6 @@ struct Trace {
|
|||
|
||||
struct ErrorInfo {
|
||||
Verbosity level;
|
||||
std::string name; // FIXME: rename
|
||||
hintformat msg;
|
||||
std::optional<ErrPos> errPos;
|
||||
std::list<Trace> traces;
|
||||
|
@ -164,8 +159,6 @@ public:
|
|||
: err(e)
|
||||
{ }
|
||||
|
||||
virtual const char* sname() const { return "BaseError"; }
|
||||
|
||||
#ifdef EXCEPTION_NEEDS_THROW_SPEC
|
||||
~BaseError() throw () { };
|
||||
const char * what() const throw () { return calcWhat().c_str(); }
|
||||
|
@ -181,12 +174,12 @@ public:
|
|||
}
|
||||
|
||||
template<typename... Args>
|
||||
BaseError & addTrace(std::optional<ErrPos> e, const std::string_view & fs, const Args & ... args)
|
||||
void addTrace(std::optional<ErrPos> e, std::string_view fs, const Args & ... args)
|
||||
{
|
||||
return addTrace(e, hintfmt(std::string(fs), args...));
|
||||
addTrace(e, hintfmt(std::string(fs), args...));
|
||||
}
|
||||
|
||||
BaseError & addTrace(std::optional<ErrPos> e, hintformat hint);
|
||||
void addTrace(std::optional<ErrPos> e, hintformat hint);
|
||||
|
||||
bool hasTrace() const { return !err.traces.empty(); }
|
||||
};
|
||||
|
@ -196,7 +189,6 @@ public:
|
|||
{ \
|
||||
public: \
|
||||
using superClass::superClass; \
|
||||
virtual const char* sname() const override { return #newClass; } \
|
||||
}
|
||||
|
||||
MakeError(Error, BaseError);
|
||||
|
@ -216,8 +208,6 @@ public:
|
|||
auto hf = hintfmt(args...);
|
||||
err.msg = hintfmt("%1%: %2%", normaltxt(hf.str()), strerror(errNo));
|
||||
}
|
||||
|
||||
virtual const char* sname() const override { return "SysError"; }
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue