Skip to content
Snippets Groups Projects
Verified Commit bacd47d0 authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

fix: tentative fix for error and WASM

parent cbe67f49
No related branches found
No related tags found
No related merge requests found
Pipeline #3986 failed
use std::fmt::{self, Display, Formatter};
#[cfg(feature = "wasm")]
use wasm_bindgen::prelude::*;
#[cfg(feature = "wasm")]
use wasm_bindgen::convert::*;
/// Top level enum for error handling.
/// Most of the time, you will want to use the `CustomError` variant
/// to provide a more detailed error message.
#[derive(Debug)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Error {
NotFound,
BadRequest,
......@@ -27,3 +33,13 @@ impl Display for Error {
write!(f, "{}", self.description())
}
}
#[cfg(feature = "wasm")]
impl IntoWasmAbi for Error {
type Abi = <Vec<u8> as IntoWasmAbi>::Abi;
#[inline]
fn into_abi(self) -> Self::Abi {
self.description().into_abi();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment