Implement Error for Creation Error (#180)

This commit is contained in:
Mackenzie Clark 2019-02-14 19:22:19 -08:00 committed by GitHub
parent 6e87676160
commit 09ba27390c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -219,6 +219,17 @@ impl PartialEq for CreationError {
}
}
impl std::fmt::Display for CreationError {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
CreationError::UnableToCreateMemory => write!(f, "Unable to Create Memory"),
CreationError::UnableToCreateTable => write!(f, "Unable to Create Table"),
}
}
}
impl std::error::Error for CreationError {}
/// The amalgamation of all errors that can occur
/// during the compilation, instantiation, or execution
/// of a webassembly module.