diff --git a/crates/environ/src/compilation.rs b/crates/environ/src/compilation.rs index 797d7d82a732..acb349ac8312 100644 --- a/crates/environ/src/compilation.rs +++ b/crates/environ/src/compilation.rs @@ -152,11 +152,11 @@ pub type Traps = PrimaryMap>; #[derive(Error, Debug)] pub enum CompileError { /// A wasm translation error occured. - #[error("WebAssembly translation error: {0}")] + #[error("WebAssembly translation error")] Wasm(#[from] WasmError), /// A compilation error occured. - #[error("Compilation error: {0}")] + #[error("Compilation error")] Codegen(#[from] CodegenError), /// A compilation error occured. diff --git a/crates/jit/src/action.rs b/crates/jit/src/action.rs index d9ca5f306344..a09357af1c92 100644 --- a/crates/jit/src/action.rs +++ b/crates/jit/src/action.rs @@ -114,7 +114,7 @@ pub enum ActionOutcome { #[derive(Error, Debug)] pub enum ActionError { /// An internal implementation error occurred. - #[error("{0}")] + #[error("Failed to setup a module")] Setup(#[from] SetupError), /// No field with the specified name was present. diff --git a/crates/jit/src/context.rs b/crates/jit/src/context.rs index 267844f523c5..77b3e2e52f77 100644 --- a/crates/jit/src/context.rs +++ b/crates/jit/src/context.rs @@ -23,10 +23,10 @@ pub struct UnknownInstance { #[derive(Error, Debug)] pub enum ContextError { /// An unknown instance name was used. - #[error("{0}")] + #[error("An error occured due to an unknown instance being specified")] Instance(#[from] UnknownInstance), /// An error occured while performing an action. - #[error("{0}")] + #[error("An error occurred while performing an action")] Action(#[from] ActionError), } diff --git a/crates/jit/src/instantiate.rs b/crates/jit/src/instantiate.rs index 1e41ea9ba849..e5f65e29bf50 100644 --- a/crates/jit/src/instantiate.rs +++ b/crates/jit/src/instantiate.rs @@ -35,12 +35,12 @@ pub enum SetupError { Validate(String), /// A wasm translation error occured. - #[error("WebAssembly compilation error: {0}")] + #[error("WebAssembly failed to compile")] Compile(#[from] CompileError), /// Some runtime resource was unavailable or insufficient, or the start function /// trapped. - #[error("Instantiation error: {0}")] + #[error("Instantiation failed during setup")] Instantiate(#[from] InstantiationError), /// Debug information generation error occured. diff --git a/crates/runtime/src/instance.rs b/crates/runtime/src/instance.rs index 467fbec10ba5..f1b178ce8279 100644 --- a/crates/runtime/src/instance.rs +++ b/crates/runtime/src/instance.rs @@ -1289,7 +1289,7 @@ pub enum InstantiationError { Resource(String), /// A wasm link error occured. - #[error("{0}")] + #[error("Failed to link module")] Link(#[from] LinkError), /// A compilation error occured. diff --git a/crates/wast/src/wast.rs b/crates/wast/src/wast.rs index 20251012851e..2ec0e63d93c8 100644 --- a/crates/wast/src/wast.rs +++ b/crates/wast/src/wast.rs @@ -310,7 +310,7 @@ impl WastContext { Ok(()) => bail!("{}\nexpected module to fail to build", context(span)), Err(e) => e, }; - let error_message = err.to_string(); + let error_message = format!("{:?}", err); if !error_message.contains(&message) { // TODO: change to bail! println!( @@ -339,7 +339,7 @@ impl WastContext { } Err(e) => e, }; - let error_message = err.to_string(); + let error_message = format!("{:?}", err); if !error_message.contains(&message) { // TODO: change to bail! println!( @@ -360,7 +360,7 @@ impl WastContext { Ok(()) => bail!("{}\nexpected module to fail to link", context(span)), Err(e) => e, }; - let error_message = err.to_string(); + let error_message = format!("{:?}", err); if !error_message.contains(&message) { bail!( "{}\nassert_unlinkable: expected {}, got {}",