diff options
Diffstat (limited to 'webhogg/wasm/src/error.rs')
-rw-r--r-- | webhogg/wasm/src/error.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/webhogg/wasm/src/error.rs b/webhogg/wasm/src/error.rs index 1c6ec27..fbb6bf8 100644 --- a/webhogg/wasm/src/error.rs +++ b/webhogg/wasm/src/error.rs @@ -3,6 +3,8 @@ use std::error::Error; #[derive(Debug)] pub enum WasmError { WebGl2ContextCreation(String), + Shader(String), + WebGlBuffer(String), } impl std::fmt::Display for WasmError { @@ -15,6 +17,8 @@ impl Error for WasmError { fn description(&self) -> &str { match self { WasmError::WebGl2ContextCreation(msg) => msg, + WasmError::Shader(msg) => msg, + WasmError::WebGlBuffer(msg) => msg, } } @@ -25,6 +29,8 @@ impl WasmError { pub fn name(&self) -> &str { match self { WasmError::WebGl2ContextCreation(_) => "WebGl2ContextCreationError", + WasmError::Shader(_) => "ShaderError", + WasmError::WebGlBuffer(_) => "WebGlBufferError", } } } |