Skip to content

Commit c44722b

Browse files
committed
Make grammar::Error more verbose.
The carried `libloading::Error` is useful to debug actual issues occurring on dependent projects — I had to adapt a bit of code in kak-tree-sitter to pinpoint an issue while loading grammars with the wrong symbol (I was still trying to read tree_sitter_<lang> while the API of tree-house sets the prefix on its own), and I could have seen that right away if the {err} was present in the Display impl.
1 parent bd161d9 commit c44722b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bindings/src/grammar.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@ impl TryFrom<LanguageFn> for Grammar {
8989

9090
#[derive(thiserror::Error, Debug)]
9191
pub enum Error {
92-
#[error("Error opening dynamic library {path:?}")]
92+
#[error("Error opening dynamic library {path:?}: {err}")]
9393
DlOpen {
9494
#[source]
9595
err: libloading::Error,
9696
path: PathBuf,
9797
},
98-
#[error("Failed to load symbol {symbol}")]
98+
#[error("Failed to load symbol {symbol}: {err}")]
9999
DlSym {
100100
#[source]
101101
err: libloading::Error,

0 commit comments

Comments
 (0)