Switch to custom templating library

This commit is contained in:
2021-05-20 16:16:02 +02:00
parent 6f8e1d46c7
commit 00412be372
8 changed files with 207 additions and 395 deletions

View File

@ -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);
}
}
}