File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -415,13 +415,19 @@ fn expand_set_property_fn(props: &[PropDesc]) -> TokenStream2 {
415
415
field_ident,
416
416
member,
417
417
set,
418
+ ty,
418
419
..
419
420
} = p;
420
421
421
422
let crate_ident = crate_ident_new ( ) ;
422
423
let enum_ident = name_to_enum_ident ( name. value ( ) ) ;
423
424
let span = p. attrs_span ;
424
- let expect = quote ! ( . expect( "Can't convert glib::value to property type" ) ) ;
425
+ let expect = quote ! ( . unwrap_or_else(
426
+ |err| panic!(
427
+ "Invalid conversion from `glib::value::Value` to `{}` inside setter for property `{}`: {:?}" ,
428
+ :: std:: any:: type_name:: <<#ty as #crate_ident:: Property >:: Value >( ) , #name, err
429
+ )
430
+ ) ) ;
425
431
set. as_ref ( ) . map ( |set| {
426
432
let body = match ( member, set) {
427
433
( _, MaybeCustomFn :: Custom ( expr) ) => quote ! (
You can’t perform that action at this time.
0 commit comments