use std::{error, fmt};
use super::ExecutionError;
#[derive(Debug)]
pub enum ContextError {
RuntimeCreationFailed,
ContextCreationFailed,
Execution(ExecutionError),
#[doc(hidden)]
__NonExhaustive,
}
impl fmt::Display for ContextError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
use ContextError::*;
match self {
RuntimeCreationFailed => write!(f, "Could not create runtime"),
ContextCreationFailed => write!(f, "Could not create context"),
Execution(e) => e.fmt(f),
__NonExhaustive => unreachable!(),
}
}
}
impl error::Error for ContextError {}