mirror of
https://github.com/sayanarijit/xplr
synced 2024-11-04 18:00:14 +00:00
Even better error messages
This commit is contained in:
parent
4a34780eb4
commit
723dd6ec2c
@ -189,7 +189,7 @@ fn fmt_msg_in(args: Vec<String>) -> Result<String> {
|
||||
}
|
||||
('q', Some('%')) => {
|
||||
let arg = args.next().context(format!(
|
||||
"argument missing for the placeholder at col {}",
|
||||
"argument missing for the placeholder at column {}",
|
||||
col
|
||||
))?;
|
||||
msg.push_str(&json::to_string(&arg)?);
|
||||
@ -197,7 +197,7 @@ fn fmt_msg_in(args: Vec<String>) -> Result<String> {
|
||||
}
|
||||
('s', Some('%')) => {
|
||||
let arg = args.next().context(format!(
|
||||
"argument missing for the placeholder at col {}",
|
||||
"argument missing for the placeholder at column {}",
|
||||
col
|
||||
))?;
|
||||
msg.push_str(&arg);
|
||||
@ -205,7 +205,7 @@ fn fmt_msg_in(args: Vec<String>) -> Result<String> {
|
||||
}
|
||||
(ch, Some('%')) => {
|
||||
bail!(format!(
|
||||
"invalid placeholder (%{}) at col {}, use one of %s %q %%",
|
||||
"invalid placeholder '%{}' at column {}, use one of '%s' or '%q', or escape it using '%%'",
|
||||
ch, col
|
||||
));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user