From: Daan De Meyer Date: Sat, 21 Sep 2024 22:59:31 +0000 (+0200) Subject: Show proper error if parsing history fails X-Git-Tag: v25~270^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4bddf0cfd2e487cb5ae696234b9f900276ee3e26;p=thirdparty%2Fmkosi.git Show proper error if parsing history fails --- diff --git a/mkosi/config.py b/mkosi/config.py index e11ef0106..18c9e7696 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -3955,7 +3955,13 @@ def parse_config( and not args.force and Path(".mkosi-private/history/latest.json").exists() ): - prev = Config.from_json(Path(".mkosi-private/history/latest.json").read_text()) + try: + prev = Config.from_json(Path(".mkosi-private/history/latest.json").read_text()) + except ValueError: + die( + "Unable to parse history from .mkosi-private/history/latest.json", + hint="Build with -f to generate a new history file from scratch", + ) # If we're operating on a previously built image (qemu, boot, shell, ...), we're not rebuilding the # image and the configuration of the latest build is available, we load the config that was used to