From 450a999314af8e27f134562fc2a85a7e3fe4c90a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Kl=C3=B6tzke?= Date: Sun, 3 Nov 2024 18:21:46 +0100 Subject: [PATCH] audit: improve error message on schema failures If the audit schema fails, it is most probably caused by an audit of a newer Bob version. Add a hint to the user that an update might help. --- pym/bob/audit.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pym/bob/audit.py b/pym/bob/audit.py index afb0cb50..b750b960 100644 --- a/pym/bob/audit.py +++ b/pym/bob/audit.py @@ -338,7 +338,8 @@ def load(self, file, name): r["artifact-id"] : Artifact.fromData(r) for r in tree["references"] } except schema.SchemaError as e: - raise ParseError(name + ": Invalid audit record: " + str(e)) + raise ParseError(name + ": Invalid audit record: " + str(e), + help="Try updating to the latest Bob version. The audit probably contains new record types.") except ValueError as e: raise ParseError(name + ": Invalid json: " + str(e)) self.__validate()