1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//! This library provides a convenience derive macro for `impl From<ErrorType> for JsValue`.
//!
//! # Example
//!
//! This example uses the `thiserror` crate to simplify the example, but it should work for any
//! type that implements [`std::error::Error`].
//!
//! ```rust
//! use derive_jserror::JsError;
//! use wasm_bindgen::prelude::*;
//! use thiserror::Error;
//!
//! #[derive(Error, JsError, Debug)]
//! #[error("test error type")]
//! struct TestError;
//!
//! #[wasm_bindgen]
//! pub fn func_returns_result() -> Result<(), TestError> {
//! Err(TestError)
//! }
//! ```
use ;
use quote;
use ;