Skip to content

Commit

Permalink
Merge pull request #36 from DongzeHE/develop
Browse files Browse the repository at this point in the history
improve error handling
  • Loading branch information
rob-p committed Jan 6, 2022
2 parents 00faaed + 0a87814 commit d373637
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::constants as afconst;
use crate::eq_class::IndexedEqList;
use bstr::io::BufReadExt;
use core::fmt;
use libradicl::utils::SPLICE_MASK_U32;
use needletail::bitkmer::*;
use std::collections::{HashMap, HashSet};
Expand Down Expand Up @@ -735,14 +736,20 @@ impl InternalVersionInfo {
Ok(())
} else {
let s = format!(
"version {:?} is incompatible with version {:?}",
self, other
"running alevin-fry {} on {} results, please regenerate the results using alevin-fry {} or greater",
self, other, self
);
Err(s)
}
}
}

impl fmt::Display for InternalVersionInfo {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "v{}.{}.{}", self.major, self.minor, self.patch)
}
}

#[derive(Error, Debug)]
pub enum VersionParseError {
#[error("The version string should be of the format x.y.z; it was `{0}`")]
Expand Down

0 comments on commit d373637

Please sign in to comment.