mirror of
https://github.com/NixOS/nix
synced 2025-06-29 19:03:16 +02:00
errorinfo constructor test
This commit is contained in:
parent
2d0f766a77
commit
39ff80d031
4 changed files with 16 additions and 5 deletions
|
@ -83,6 +83,7 @@ class BaseError : public std::exception
|
|||
protected:
|
||||
string prefix_; // used for location traces etc.
|
||||
ErrorInfo err;
|
||||
|
||||
std::optional<string> what_;
|
||||
const string& calcWhat()
|
||||
{
|
||||
|
@ -107,18 +108,18 @@ public:
|
|||
.hint = hintfmt(args...)
|
||||
}
|
||||
, status(status)
|
||||
{ }
|
||||
{ }
|
||||
|
||||
template<typename... Args>
|
||||
BaseError(const Args & ... args)
|
||||
: err { .level = lvlError,
|
||||
.hint = hintfmt(args...)
|
||||
}
|
||||
{ }
|
||||
{ }
|
||||
|
||||
BaseError(ErrorInfo e)
|
||||
: err(e)
|
||||
{ }
|
||||
{ }
|
||||
|
||||
virtual const char* sname() const { return "BaseError"; }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue