1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! User-facing render and parse failures as a simple string message.
//!
//! Functions in this crate that can fail return [`Result`]`<T, `[`RunjucksError`]`>`.
use fmt;
/// Error returned when lexing, parsing, or rendering cannot complete.
///
/// Carries a human-readable message suitable for logs or passing to JavaScript via the NAPI layer.
///
/// # Examples
///
/// ```
/// use runjucks_core::RunjucksError;
///
/// let e = RunjucksError::new("unclosed tag");
/// assert_eq!(e.to_string(), "unclosed tag");
/// ```
/// Convenient alias for `std::result::Result` with [`RunjucksError`] as the error type.
pub type Result<T> = Result;