]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rv/rvgen: introduce AutomataError exception class
authorWander Lairson Costa <wander@redhat.com>
Mon, 23 Feb 2026 16:17:44 +0000 (13:17 -0300)
committerGabriele Monaco <gmonaco@redhat.com>
Tue, 31 Mar 2026 14:47:50 +0000 (16:47 +0200)
commita115ee5a32275d5f171506dc65e2130e218d2117
tree295be465f93b41d43d3cc1bdebc0b822029910e1
parentb133207deb72609ad4da40c4d50128a5e150677b
rv/rvgen: introduce AutomataError exception class

Replace the generic except Exception block with a custom AutomataError
class that inherits from Exception. This provides more precise exception
handling for automata parsing and validation errors while avoiding
overly broad exception catches that could mask programming errors like
SyntaxError or TypeError.

The AutomataError class is raised when DOT file processing fails due to
invalid format, I/O errors, or malformed automaton definitions. The
main entry point catches this specific exception and provides a
user-friendly error message to stderr before exiting.

Also, replace generic exceptions raising in HA and LTL with
AutomataError.

Co-authored-by: Gabriele Monaco <gmonaco@redhat.com>
Signed-off-by: Wander Lairson Costa <wander@redhat.com>
Reviewed-by: Gabriele Monaco <gmonaco@redhat.com>
Link: https://lore.kernel.org/r/20260223162407.147003-2-wander@redhat.com
Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
tools/verification/rvgen/__main__.py
tools/verification/rvgen/rvgen/automata.py
tools/verification/rvgen/rvgen/dot2c.py
tools/verification/rvgen/rvgen/dot2k.py
tools/verification/rvgen/rvgen/generator.py
tools/verification/rvgen/rvgen/ltl2ba.py
tools/verification/rvgen/rvgen/ltl2k.py