Rendering spans
This commit is contained in:
48
src/renderer/errors.rs
Normal file
48
src/renderer/errors.rs
Normal file
@@ -0,0 +1,48 @@
|
||||
use std::error;
|
||||
use std::fmt;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct RenderError {
|
||||
pub message: String,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct CompileError {
|
||||
pub message: String,
|
||||
}
|
||||
|
||||
impl fmt::Display for RenderError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "Error rendering: {}", self.message)
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for RenderError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "Error rendering: {}", self.message)
|
||||
}
|
||||
}
|
||||
|
||||
impl error::Error for RenderError {
|
||||
fn source(&self) -> Option<&(dyn error::Error + 'static)> {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for CompileError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "Error rendering: {}", self.message)
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for CompileError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "Error rendering: {}", self.message)
|
||||
}
|
||||
}
|
||||
|
||||
impl error::Error for CompileError {
|
||||
fn source(&self) -> Option<&(dyn error::Error + 'static)> {
|
||||
None
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user