Skip to content

Commit

Permalink
audit: improve error message on schema failures
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jkloetzke committed Nov 3, 2024
1 parent bc52767 commit 450a999
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pym/bob/audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 450a999

Please sign in to comment.