all things error to error.hh

This commit is contained in:
Ben Burdette
2020-04-24 14:57:51 -06:00
parent d9632765a8
commit d8d4844b88
5 changed files with 30 additions and 167 deletions

View File

@@ -7,6 +7,24 @@
namespace nix
{
const std::string nativeSystem = SYSTEM;
BaseError & BaseError::addPrefix(const FormatOrString & fs)
{
prefix_ = fs.s + prefix_;
return *this;
}
std::string SysError::addErrno(const std::string & s)
{
errNo = errno;
return s + ": " + strerror(errNo);
}
std::optional<string> ErrorInfo::programName = std::nullopt;
std::ostream& operator<<(std::ostream &os, const hintformat &hf)