aboutsummaryrefslogtreecommitdiff
path: root/scripts/qapi/expr.py
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2022-07-22 14:23:37 -0400
committerJohn Snow <jsnow@redhat.com>2025-09-15 14:36:01 -0400
commit2d26741fc5170e51621eb365a34460fadb5f969e (patch)
tree6ea43db8c8b4a5b400eb90fdc616b567b063edc7 /scripts/qapi/expr.py
parent190d5d7fd725ff754f94e8e0cbfb69f279c82b5d (diff)
downloadqemu-2d26741fc5170e51621eb365a34460fadb5f969e.zip
qemu-2d26741fc5170e51621eb365a34460fadb5f969e.tar.gz
qemu-2d26741fc5170e51621eb365a34460fadb5f969e.tar.bz2
python: backport 'Change error classes to have better repr methods'
By passing all of the arguments to the base class and overriding the __str__ method when we want a different "human readable" message that isn't just printing the list of arguments, we can ensure that all custom error classes have a reasonable __repr__ implementation. In the case of ExecuteError, the pseudo-field that isn't actually correlated to an input argument can be re-imagined as a read-only property; this forces consistency in the class and makes the repr output more obviously correct. Signed-off-by: John Snow <jsnow@redhat.com> cherry picked from commit python-qemu-qmp@afdb7893f3b34212da4259b7202973f9a8cb85b3 Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'scripts/qapi/expr.py')
0 files changed, 0 insertions, 0 deletions