mirror of
https://github.com/orhun/git-cliff.git
synced 2024-09-11 15:05:30 +03:00
parent
5f2d0f04fe
commit
7ee3c860af
@ -40,6 +40,9 @@ pub enum Error {
|
||||
/// Error that may occur while rendering the template.
|
||||
#[error("Template render error:\n{0}")]
|
||||
TemplateRenderError(String),
|
||||
/// Error that may occur while rendering the template.
|
||||
#[error("Template render error:\n{0}\n{1}")]
|
||||
TemplateRenderDetailedError(String, String),
|
||||
/// Error that may occur during more general template operations.
|
||||
#[error("Template error: `{0}`")]
|
||||
TemplateError(#[from] tera::Error),
|
||||
|
@ -163,8 +163,15 @@ impl Template {
|
||||
Ok(v)
|
||||
}
|
||||
Err(e) => {
|
||||
return if let Some(error_source) = e.source() {
|
||||
Err(Error::TemplateRenderError(error_source.to_string()))
|
||||
return if let Some(source1) = e.source() {
|
||||
if let Some(source2) = source1.source() {
|
||||
Err(Error::TemplateRenderDetailedError(
|
||||
source1.to_string(),
|
||||
source2.to_string(),
|
||||
))
|
||||
} else {
|
||||
Err(Error::TemplateRenderError(source1.to_string()))
|
||||
}
|
||||
} else {
|
||||
Err(Error::TemplateError(e))
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user