use std;
use std::error::Error;
pub struct GraphicsError {
description: String,
}
impl GraphicsError {
pub fn new(description: String) -> GraphicsError {
GraphicsError { description: description }
}
}
impl Error for GraphicsError {
fn description(&self) -> &str {
&self.description
}
fn cause(&self) -> Option<&Error> {
None
}
}
impl std::fmt::Debug for GraphicsError {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "{}", self.description)
}
}
impl std::fmt::Display for GraphicsError {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "{}", self.description)
}
}