File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -217,15 +217,20 @@ async fn run_linter_command(
217217
218218 let run_result = command. wasi_cli_run ( ) . call_run ( & mut store) . await ;
219219
220- // The return type here is very weird.
220+ // The return type here is very weird. See
221+ // https://github.com/bytecodealliance/wasmtime/issues/10767
221222 match run_result {
222223 Ok ( res) => res. map_err ( |_| anyhow ! ( "Unknown error running linter" ) ) ?,
223224 Err ( error) => {
224225 if let Some ( exit) = error. downcast_ref :: < I32Exit > ( ) {
225- info ! ( "Call failed with exit code {:?}" , exit. 0 ) ;
226- return Ok ( false ) ;
226+ // Err(I32Exit(0)) is actually success.
227+ if exit. 0 != 0 {
228+ info ! ( "Call failed with exit code {:?}" , exit. 0 ) ;
229+ return Ok ( false ) ;
230+ }
231+ } else {
232+ return Err ( error) ;
227233 }
228- return Err ( error) ;
229234 }
230235 } ;
231236
You can’t perform that action at this time.
0 commit comments