wasi-common: instead of panicking, use an Error::Unsupported that Traps

This commit is contained in:
Pat Hickey
2021-01-07 14:05:49 -08:00
parent 030f01345a
commit b149a03d5d
5 changed files with 59 additions and 49 deletions

View File

@@ -17,6 +17,10 @@ pub enum Error {
#[error("GetRandom: {0}")]
GetRandom(#[from] getrandom::Error),
/// Some corners of the WASI standard are unsupported.
#[error("Unsupported: {0}")]
Unsupported(&'static str),
/// The host OS may return an io error that doesn't match one of the
/// wasi errno variants we expect. We do not expose the details of this
/// error to the user.