From 0dd988d2e3653d81b7bda43e0618ce330553b7bc Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 29 Apr 2016 17:33:22 +0200 Subject: [PATCH] Better error message --- src/libstore/binary-cache-store.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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();