use std::{io, str::Utf8Error, string::FromUtf8Error};
pub type Result<T, E = Error> = ::std::result::Result<T, E>;
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("`wesl metadata` exited with an error: {stderr}")]
WeslMetadata {
stderr: String,
},
#[error("failed to start `wesl metadata`: {0}")]
Io(#[from] io::Error),
#[error("cannot convert the stdout of `wesl metadata`: {0}")]
Utf8(#[from] Utf8Error),
#[error("cannot convert the stderr of `wesl metadata`: {0}")]
ErrUtf8(#[from] FromUtf8Error),
#[error("failed to interpret `wesl metadata`'s json: {0}")]
Json(#[from] ::serde_json::Error),
#[error("could not find any json in the output of `wesl metadata`")]
NoJson,
}