Skip to content

Commit

Permalink
Fix punctuation in errors built with RenderError::from_error.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkantor committed Dec 25, 2020
1 parent 792880a commit 547fe5d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/error.rs
Expand Up @@ -47,45 +47,45 @@ impl Error for RenderError {

impl From<IOError> for RenderError {
fn from(e: IOError) -> RenderError {
RenderError::from_error("Error on output generation.", e)
RenderError::from_error("Error on output generation", e)
}
}

impl From<SerdeError> for RenderError {
fn from(e: SerdeError) -> RenderError {
RenderError::from_error("Error when accessing JSON data.", e)
RenderError::from_error("Error when accessing JSON data", e)
}
}

impl From<FromUtf8Error> for RenderError {
fn from(e: FromUtf8Error) -> RenderError {
RenderError::from_error("Error on bytes generation.", e)
RenderError::from_error("Error on bytes generation", e)
}
}

impl From<ParseIntError> for RenderError {
fn from(e: ParseIntError) -> RenderError {
RenderError::from_error("Error on accessing array/vector with string index.", e)
RenderError::from_error("Error on accessing array/vector with string index", e)
}
}

impl From<TemplateError> for RenderError {
fn from(e: TemplateError) -> RenderError {
RenderError::from_error("Error with parsing template.", e)
RenderError::from_error("Error with parsing template", e)
}
}

#[cfg(feature = "script_helper")]
impl From<Box<EvalAltResult>> for RenderError {
fn from(e: Box<EvalAltResult>) -> RenderError {
RenderError::from_error("Error on converting data to Rhai dynamic.", e)
RenderError::from_error("Error on converting data to Rhai dynamic", e)
}
}

#[cfg(feature = "script_helper")]
impl From<ScriptError> for RenderError {
fn from(e: ScriptError) -> RenderError {
RenderError::from_error("Error loading rhai script.", e)
RenderError::from_error("Error loading rhai script", e)
}
}

Expand Down

0 comments on commit 547fe5d

Please sign in to comment.