Better error message

This commit is contained in:
Eelco Dolstra 2016-04-29 17:33:22 +02:00
parent 5acb691402
commit 0dd988d2e3

View file

@ -137,7 +137,12 @@ void BinaryCacheStore::narFromPath(const Path & storePath, Sink & sink)
/* Decompress the NAR. FIXME: would be nice to have the remote
side do this. */
try {
nar = decompress(info->compression, ref<std::string>(nar));
} catch (UnknownCompressionMethod &) {
throw Error(format("binary cache path %s uses unknown compression method %s")
% storePath % info->compression);
}
stats.narReadBytes += nar->size();