mirror of
https://github.com/NixOS/nix
synced 2025-06-28 01:11:15 +02:00
Get rid of explicit ErrorInfo constructors
This commit is contained in:
parent
fd64e4fb96
commit
1fb762d11f
19 changed files with 360 additions and 447 deletions
|
@ -22,7 +22,7 @@
|
|||
|
||||
namespace nix {
|
||||
|
||||
/*
|
||||
/*
|
||||
|
||||
This file defines two main structs/classes used in nix error handling.
|
||||
|
||||
|
@ -106,7 +106,7 @@ protected:
|
|||
|
||||
mutable std::optional<string> what_;
|
||||
const string& calcWhat() const;
|
||||
|
||||
|
||||
public:
|
||||
unsigned int status = 1; // exit status
|
||||
|
||||
|
@ -119,9 +119,9 @@ public:
|
|||
{ }
|
||||
|
||||
template<typename... Args>
|
||||
BaseError(const Args & ... args)
|
||||
BaseError(const std::string & fs, const Args & ... args)
|
||||
: err { .level = lvlError,
|
||||
.hint = hintfmt(args...)
|
||||
.hint = hintfmt(fs, args...)
|
||||
}
|
||||
{ }
|
||||
|
||||
|
@ -131,7 +131,11 @@ public:
|
|||
}
|
||||
{ }
|
||||
|
||||
BaseError(ErrorInfo e)
|
||||
BaseError(ErrorInfo && e)
|
||||
: err(std::move(e))
|
||||
{ }
|
||||
|
||||
BaseError(const ErrorInfo & e)
|
||||
: err(e)
|
||||
{ }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue