diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-04-29T15·33+0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-04-29T15·33+0200 |
commit | 0dd988d2e3653d81b7bda43e0618ce330553b7bc (patch) | |
tree | 5e6899794351d666751693b06dea364b43bf0579 /src | |
parent | 5acb6914020a94be8468d7670b564388c59794ee (diff) |
Better error message
Diffstat (limited to 'src')
-rw-r--r-- | src/libstore/binary-cache-store.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libstore/binary-cache-store.cc b/src/libstore/binary-cache-store.cc index 90d7fa18b94b..ff717a5dc103 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<std::string>(nar)); + 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(); |