diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-04-13 14:14:57 +0000 |
---|---|---|
committer | Baserock Gerrit <gerrit@baserock.org> | 2015-04-14 12:47:32 +0000 |
commit | fd4d6afc778f633b0e4d3df3c478599d7cc1f7fe (patch) | |
tree | 853ce1abede5322e7897831a916ec08b1defcf0f /morphlib/exts/kvm.write | |
parent | 6fa273953645808be9fc81f52eb9093d8d76f15d (diff) | |
download | morph-fd4d6afc778f633b0e4d3df3c478599d7cc1f7fe.tar.gz |
Give more helpful error when stratum artifacts in cache are corrupted
I had a stratum artifact in my artifact cache which for some reason was
0 bytes long. When building a system that included this stratum, `morph
build` gave me the following output
2015-04-13 13:48:57 ERROR Traceback (most recent call last):
File "/src/morph/morphlib/builder.py", line 539, in build_and_cache
self.unpack_strata(fs_root)
File "/src/morph/morphlib/builder.py", line 600, in unpack_strata
chunks = [ArtifactCacheReference(c) for c in json.load(f)]
File "/usr/lib/python2.7/json/__init__.py", line 290, in load
**kw)
File "/usr/lib/python2.7/json/__init__.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
With this patch, I get a better error:
ERROR: Corruption detected: No JSON object could be decoded while
loading
/src/build/cache/artifacts/8b4422c58ecb2a085b142fbba74b760f501f65d4b2885bf707994973230e0c58.stratum.build-essential-minimal
Change-Id: I0ad359901c5da75bd26d5a1a8108ef4e6f1d7708
Diffstat (limited to 'morphlib/exts/kvm.write')
0 files changed, 0 insertions, 0 deletions