Skip to content

fix: don't throw error when exit code is 0#537

Merged
chenyan2002 merged 2 commits intomainfrom
yan/fix-exit
Oct 6, 2025
Merged

fix: don't throw error when exit code is 0#537
chenyan2002 merged 2 commits intomainfrom
yan/fix-exit

Conversation

@chenyan2002
Copy link
Contributor

With WASIp2, exit always returns Err (see code). We need to silence the error when the exit code is 0. This is the same treatment as in xqd.

if exit.0 == 0 {
return Ok(());
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add code to print "exited with error:" instead of "trapped", like we do below for modules?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

Copy link
Contributor

@dgohman-fastly dgohman-fastly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@chenyan2002 chenyan2002 merged commit f2ea186 into main Oct 6, 2025
13 checks passed
@chenyan2002 chenyan2002 deleted the yan/fix-exit branch October 6, 2025 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants