mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-27 12:29:41 +00:00
Python: Improve diagnostics when invoking a callback fails
This commit is contained in:
parent
d3b0e63c96
commit
c83615cfb1
1 changed files with 4 additions and 2 deletions
|
@ -343,14 +343,16 @@ impl GcVisibleCallbacks {
|
|||
let result = match callable.call(py, py_args, None) {
|
||||
Ok(result) => result,
|
||||
Err(err) => {
|
||||
eprintln!("Python: Invoking python callback threw an exception: {err}");
|
||||
eprintln!(
|
||||
"Python: Invoking python callback for {name} threw an exception: {err}"
|
||||
);
|
||||
return Value::Void;
|
||||
}
|
||||
};
|
||||
let pv: PyValue = match result.extract(py) {
|
||||
Ok(value) => value,
|
||||
Err(err) => {
|
||||
eprintln!("Python: Unable to convert return value of Python callback to Slint value: {err}");
|
||||
eprintln!("Python: Unable to convert return value of Python callback for {name} to Slint value: {err}");
|
||||
return Value::Void;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue