cranelift-module: make backend error an anyhow::Error
This allows us to retain richer information from backend errors. We already have `anyhow` as a dep in several places in the wasmtime tree, and in cranelift-faerie. faerie is the only user of this variant. Existing code that puts a String into the Backend error can trivially adapt their code to emit an anyhow::Error.
This commit is contained in:
@@ -149,7 +149,7 @@ pub enum ModuleError {
|
||||
Compilation(#[from] CodegenError),
|
||||
/// Wraps a generic error from a backend
|
||||
#[error("Backend error: {0}")]
|
||||
Backend(String),
|
||||
Backend(#[source] anyhow::Error),
|
||||
}
|
||||
|
||||
/// A convenient alias for a `Result` that uses `ModuleError` as the error type.
|
||||
|
||||
Reference in New Issue
Block a user