Improved out-of-range error messages

This commit is contained in:
Josh Mitchell
2020-11-15 17:44:49 +11:00
parent 4a71ed001c
commit 2221531f75
2 changed files with 15 additions and 8 deletions

View File

@@ -277,7 +277,7 @@ impl Trajectory for XTCTrajectory {
if let Some(err) = check_code(code, ErrorTask::Read) {
return Err(err);
}
frame.step = usize::try_from(step).map_err(|_| Error::StepSizeOutOfRange(step))?;
frame.step = usize::try_from(step).map_err(|_| Error::StepOutOfRange(step))?;
Ok(())
}
}
@@ -406,7 +406,7 @@ impl Trajectory for TRRTrajectory {
if let Some(err) = check_code(code, ErrorTask::Read) {
return Err(err);
}
frame.step = usize::try_from(step).map_err(|_| Error::StepSizeOutOfRange(step))?;
frame.step = usize::try_from(step).map_err(|_| Error::StepOutOfRange(step))?;
Ok(())
}
}