1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 00:11:17 +02:00

Report substituter errors to clients of the Nix daemon

This commit is contained in:
Eelco Dolstra 2012-08-01 11:19:24 -04:00
parent 4d1b64f118
commit c770a2422a
5 changed files with 53 additions and 30 deletions

View file

@ -253,7 +253,7 @@ string readLine(int fd)
if (errno != EINTR)
throw SysError("reading a line");
} else if (rd == 0)
throw Error("unexpected EOF reading a line");
throw EndOfFile("unexpected EOF reading a line");
else {
if (ch == '\n') return s;
s += ch;
@ -1015,6 +1015,13 @@ string concatStringsSep(const string & sep, const Strings & ss)
}
string chomp(const string & s)
{
size_t i = s.find_last_not_of(" \n\r\t");
return i == string::npos ? "" : string(s, 0, i);
}
string statusToString(int status)
{
if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {