Skip to content

Commit b16cbec

Browse files
committed
Log on errors
1 parent 7f221e7 commit b16cbec

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

src/ast.rs

+16-4
Original file line numberDiff line numberDiff line change
@@ -2855,7 +2855,10 @@ where
28552855

28562856
let leaf = scope
28572857
.leaf_name()
2858-
.map_err(|_| fmt::Error)?;
2858+
.map_err(|e| {
2859+
log!("Error getting leaf name: {}", e);
2860+
fmt::Error
2861+
})?;
28592862

28602863
match *self {
28612864
CtorDtorName::CompleteConstructor
@@ -4276,7 +4279,10 @@ impl TemplateParam {
42764279
) -> ::std::result::Result<&'subs TemplateArg, fmt::Error> {
42774280
scope
42784281
.get_template_arg(self.0)
4279-
.map_err(|_| fmt::Error)
4282+
.map_err(|e| {
4283+
log!("Error obtaining template argument: {}", e);
4284+
fmt::Error
4285+
})
42804286
}
42814287
}
42824288

@@ -6015,7 +6021,10 @@ where
60156021
} else {
60166022
start
60176023
};
6018-
let s = ::std::str::from_utf8(&ctx.input[start..end]).map_err(|_| fmt::Error)?;
6024+
let s = ::std::str::from_utf8(&ctx.input[start..end]).map_err(|e| {
6025+
log!("Error writing literal: {}", e);
6026+
fmt::Error
6027+
})?;
60196028
ctx.write_str(s)
60206029
}
60216030

@@ -6057,7 +6066,10 @@ where
60576066
write!(ctx, ")[")?;
60586067
start
60596068
};
6060-
let s = ::std::str::from_utf8(&ctx.input[start..end]).map_err(|_| fmt::Error)?;
6069+
let s = ::std::str::from_utf8(&ctx.input[start..end]).map_err(|e| {
6070+
log!("Error writing literal: {}", e);
6071+
fmt::Error
6072+
})?;
60616073
ctx.write_str(s)?;
60626074
write!(ctx, "]")
60636075
}

0 commit comments

Comments
 (0)