Skip to content

Commit

Permalink
feat(core): add trace! on error
Browse files Browse the repository at this point in the history
To easier debug
  • Loading branch information
SARDONYX-sard committed Jan 25, 2024
1 parent 2308e47 commit a5dc8d3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dar2oar_core/src/condition_parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ pub fn parse_dar2oar(input: &str) -> Result<Vec<ConditionSet>> {
nom::Err::Error(err) => err,
nom::Err::Failure(err) => err,
};

tracing::trace!("Entered ConvertError::InvalidDarSyntax");
return Err(ConvertError::InvalidDarSyntax(convert_error(input, err)));
}
};
Expand All @@ -35,6 +37,9 @@ pub fn parse_dar2oar(input: &str) -> Result<Vec<ConditionSet>> {
tracing::debug!("Parsed DAR => Serialized OAR:\n{:#?}", &oar);
Ok(oar.try_into()?)
}
false => Err(ConvertError::IncompleteParseDar(remain.into())),
false => {
tracing::trace!("Entered ConvertError::IncompleteParseDar");
Err(ConvertError::IncompleteParseDar(remain.into()))
}
}
}

0 comments on commit a5dc8d3

Please sign in to comment.