Validate descriptor max on creating new table or memory (#186)

This commit is contained in:
Mackenzie Clark
2019-02-15 13:14:42 -08:00
committed by GitHub
parent b68b109b7d
commit 2d2d708500
3 changed files with 23 additions and 0 deletions

View File

@ -266,6 +266,7 @@ impl std::fmt::Display for CallError {
pub enum CreationError {
UnableToCreateMemory,
UnableToCreateTable,
InvalidDescriptor(String),
}
impl PartialEq for CreationError {
@ -279,6 +280,11 @@ impl std::fmt::Display for CreationError {
match self {
CreationError::UnableToCreateMemory => write!(f, "Unable to Create Memory"),
CreationError::UnableToCreateTable => write!(f, "Unable to Create Table"),
CreationError::InvalidDescriptor(msg) => write!(
f,
"Unable to create because the supplied descriptor is invalid: \"{}\"",
msg
),
}
}
}