mirror of
https://github.com/zaphar/ucg.git
synced 2025-07-23 18:29:50 -04:00
REFACTOR: Correctly use parse errors as a cause.
This commit is contained in:
parent
1699801895
commit
923ba89e2f
@ -329,11 +329,17 @@ impl<'a> FileBuilder<'a> {
|
|||||||
Some(val) => Ok(val),
|
Some(val) => Ok(val),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(err) => Err(Box::new(error::BuildError::with_pos(
|
// TODO(jwall): We can probably use actual errors now?
|
||||||
format!("{}", err,),
|
Err(err) => {
|
||||||
error::ErrorType::ParseError,
|
let cause = Box::new(simple_error::SimpleError::new(err));
|
||||||
(&input).into(),
|
Err(error::BuildError::with_pos(
|
||||||
))),
|
"Unable to parse input",
|
||||||
|
error::ErrorType::ParseError,
|
||||||
|
(&input).into(),
|
||||||
|
)
|
||||||
|
.wrap_cause(cause)
|
||||||
|
.to_boxed())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user