Switch to custom templating library
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
use compound_error::CompoundError;
|
||||
use std::io;
|
||||
use std::path::{Path, PathBuf};
|
||||
use thiserror::Error;
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct Errors {
|
||||
@ -12,10 +12,13 @@ pub struct Error {
|
||||
inner: InnerError,
|
||||
}
|
||||
|
||||
#[derive(CompoundError, Debug)]
|
||||
#[derive(Debug, Error)]
|
||||
pub enum InnerError {
|
||||
IoErr(io::Error),
|
||||
TemplateErr(templar::TemplarError),
|
||||
#[error("IO Error: {0}")]
|
||||
IoErr(#[from] io::Error),
|
||||
|
||||
#[error("Failed to parse template file")]
|
||||
TemplateParseErr,
|
||||
}
|
||||
|
||||
impl From<Vec<Error>> for Errors {
|
||||
@ -51,8 +54,8 @@ impl Errors {
|
||||
|
||||
error!("{} errors occured:", self.errors.len());
|
||||
for (i, error) in self.errors.iter().enumerate() {
|
||||
error!("{:.2}. {:?}", i, error.location);
|
||||
error!(" {:?}", error.inner);
|
||||
error!(" err {:02} at {:?}:", i, error.location);
|
||||
error!(" {}", error.inner);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user