1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-17 07:52:43 +01:00

Some notational convenience for formatting strings

We can now write

  throw Error("file '%s' not found", path);

instead of

  throw Error(format("file '%s' not found") % path);

and similarly

  printError("file '%s' not found", path);

instead of

  printMsg(lvlError, format("file '%s' not found") % path);
This commit is contained in:
Eelco Dolstra 2016-09-21 16:00:03 +02:00
parent 3f8e620b19
commit 4036185cb4
6 changed files with 81 additions and 22 deletions

View file

@ -564,7 +564,7 @@ void RemoteStore::Connection::processStderr(Sink * sink, Source * source)
if (msg == STDERR_ERROR) {
string error = readString(from);
unsigned int status = readInt(from);
throw Error(format("%1%") % error, status);
throw Error(status, error);
}
else if (msg != STDERR_LAST)
throw Error("protocol error processing standard error");