Skip to content

Commit

Permalink
expose hcl-edit parser error message (#334)
Browse files Browse the repository at this point in the history
hcl-edit parser error already returns
line and location, but message is also
required for user to be able to pretty
print the error themselves
  • Loading branch information
dzhou121 authored Apr 13, 2024
1 parent e746913 commit 5a198d6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/hcl-edit/src/parser/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ impl Error {
}
}

/// Returns the message in the input where the error occurred.
pub fn message(&self) -> &str {
&self.inner.message
}

/// Returns the line from the input where the error occurred.
///
/// Note that this returns the full line containing the invalid input. Use
Expand Down

0 comments on commit 5a198d6

Please sign in to comment.