Fix conformance errors

This commit is contained in:
Tony Garnock-Jones 2021-08-10 08:40:20 -04:00
parent 32ebebec34
commit e02ee00894
1 changed files with 12 additions and 1 deletions

View File

@ -53,7 +53,18 @@ pub enum ParseError {
#[error("Input not conformant with Schema: {0}")]
ConformanceError(&'static str),
#[error(transparent)]
Preserves(#[from] preserves::error::Error),
Preserves(preserves::error::Error),
}
impl From<preserves::error::Error> for ParseError {
fn from(v: preserves::error::Error) -> Self {
match v {
preserves::error::Error::Expected(_, _) =>
ParseError::ConformanceError("preserves::error::Error::Expected"),
_ =>
ParseError::Preserves(v),
}
}
}
impl From<io::Error> for ParseError {