use miette::Diagnostic;
use thiserror::Error;
#[derive(Debug, Error, Diagnostic)]
#[non_exhaustive]
pub enum AssetError {
#[error("asset not found: {0}")]
#[diagnostic(code(rtb::assets::not_found))]
NotFound(String),
#[error("asset `{path}` is not valid UTF-8")]
#[diagnostic(code(rtb::assets::not_utf8))]
NotUtf8 {
path: String,
},
#[error("failed to parse asset `{path}` as {format}: {message}")]
#[diagnostic(code(rtb::assets::parse), help("verify the file is well-formed {format}"))]
Parse {
path: String,
format: &'static str,
message: String,
},
}