File tree Expand file tree Collapse file tree 1 file changed +22
-5
lines changed Expand file tree Collapse file tree 1 file changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -85,15 +85,32 @@ pub fn get_matches(_attr: TokenStream, item: TokenStream) -> TokenStream {
85
85
}
86
86
} ;
87
87
quote ! {
88
- if let :: core:: option:: Option :: Some ( data) = #data {
89
- #fn_name( input, data)
90
- } else {
91
- :: abi_stable:: std_types:: RVec :: new( )
88
+ match :: std:: panic:: catch_unwind( || {
89
+ if let :: core:: option:: Option :: Some ( data) = #data {
90
+ #fn_name( input, data)
91
+ } else {
92
+ :: abi_stable:: std_types:: RVec :: new( )
93
+ }
94
+ }
95
+ ) {
96
+ :: core:: result:: Result :: Ok ( result) => result,
97
+ :: core:: result:: Result :: Err ( _) => {
98
+ :: std:: eprintln!( "Plugin '{}' panicked" , anyrun_internal_info( ) . name) ;
99
+ :: abi_stable:: std_types:: RVec :: new( )
100
+ }
92
101
}
93
102
}
94
103
} else {
95
104
quote ! {
96
- #fn_name( input)
105
+ match :: std:: panic:: catch_unwind( || {
106
+ #fn_name( input)
107
+ } ) {
108
+ :: core:: result:: Result :: Ok ( result) => result,
109
+ :: core:: result:: Result :: Err ( _) => {
110
+ :: std:: eprintln!( "Plugin '{}' panicked" , anyrun_internal_info( ) . name) ;
111
+ :: abi_stable:: std_types:: RVec :: new( )
112
+ }
113
+ }
97
114
}
98
115
} ;
99
116
You can’t perform that action at this time.
0 commit comments