From 09ba27390cad6313738e4e5b87e2a2d43baf619e Mon Sep 17 00:00:00 2001 From: Mackenzie Clark Date: Thu, 14 Feb 2019 19:22:19 -0800 Subject: [PATCH] Implement Error for Creation Error (#180) --- lib/runtime-core/src/error.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/runtime-core/src/error.rs b/lib/runtime-core/src/error.rs index 9e1eba8fe..539f94e42 100644 --- a/lib/runtime-core/src/error.rs +++ b/lib/runtime-core/src/error.rs @@ -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.