@@ -118,8 +118,11 @@ impl RunCommand {
118118 . handle_module ( & store, & module_registry)
119119 . with_context ( || format ! ( "failed to run main module `{}`" , self . module. display( ) ) )
120120 {
121- Ok ( ( ) ) => ( ) ,
121+ Ok ( ( ) ) => {
122+ eprintln ! ( "ok!" ) ;
123+ }
122124 Err ( e) => {
125+ eprintln ! ( "error: {:?}" , e) ;
123126 // If the program exited because of a trap, return an error code
124127 // to the outside environment indicating a more severe problem
125128 // than a simple failure.
@@ -139,6 +142,7 @@ impl RunCommand {
139142 return Err ( e) ;
140143 }
141144 }
145+ eprintln ! ( "all good" ) ;
142146
143147 Ok ( ( ) )
144148 }
@@ -227,27 +231,32 @@ impl RunCommand {
227231 }
228232
229233 fn handle_module ( & self , store : & Store , module_registry : & ModuleRegistry ) -> Result < ( ) > {
234+ eprintln ! ( "instantiating module..." ) ;
230235 let ( instance, module, data) =
231236 Self :: instantiate_module ( store, module_registry, & self . module ) ?;
232237
233238 // If a function to invoke was given, invoke it.
234239 if let Some ( name) = self . invoke . as_ref ( ) {
240+ eprintln ! ( "invoking {}..." , name) ;
235241 let data = ModuleData :: new ( & data) ?;
236242 self . invoke_export ( instance, & data, name) ?;
237243 } else if module
238244 . exports ( )
239245 . iter ( )
240246 . any ( |export| export. name ( ) . is_empty ( ) )
241247 {
248+ eprintln ! ( "invoking default command export..." ) ;
242249 // Launch the default command export.
243250 let data = ModuleData :: new ( & data) ?;
244251 self . invoke_export ( instance, & data, "" ) ?;
245252 } else {
253+ eprintln ! ( "invoking the _start function..." ) ;
246254 // If the module doesn't have a default command export, launch the
247255 // _start function if one is present, as a compatibility measure.
248256 let data = ModuleData :: new ( & data) ?;
249257 self . invoke_export ( instance, & data, "_start" ) ?;
250258 }
259+ eprintln ! ( "success!" ) ;
251260
252261 Ok ( ( ) )
253262 }
0 commit comments