use thiserror::Error;
use translatable_shared::misc::language::Language;
use translatable_shared::translations::node::TranslationNodeError;
#[derive(Error, Debug)]
pub enum RuntimeError {
#[error("{0:#}")]
TranslationNode(#[from] TranslationNodeError),
#[error("The path '{0}' could not be found")]
PathNotFound(String),
#[error("The language '{0:?}' ('{0:#}') is not available for the path '{1}'")]
LanguageNotAvailable(Language, String),
}
impl RuntimeError {
#[cold]
#[inline]
pub fn cause(&self) -> String {
format!("{self:#}")
}
}