diff --git a/src/libstore/binary-cache-store.cc b/src/libstore/binary-cache-store.cc index 90d7fa18b..ff717a5dc 100644 --- a/src/libstore/binary-cache-store.cc +++ b/src/libstore/binary-cache-store.cc @@ -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. */ - nar = decompress(info->compression, ref(nar)); + try { + nar = decompress(info->compression, ref(nar)); + } catch (UnknownCompressionMethod &) { + throw Error(format("binary cache path ā€˜%sā€™ uses unknown compression method ā€˜%sā€™") + % storePath % info->compression); + } stats.narReadBytes += nar->size();