Raising an error on corrupt patches rather than panicking

pmeunier
Dec 15, 2023, 8:10 PM
T7YIRFWDA75AC2JSWVVAIDK6J5ICOGYHTGZNGLTJU6SIGXKUGCLQC

Dependencies

  • [2] ZJWCPRMH Fixing known patches in deleted contexts
  • [3] FAOGX7G3 Outputting the repo after the last Git import
  • [4] ZDK3GNDB Tag transactions (including a massive refactoring of errors)
  • [5] I24UEJQL Various post-fire fixes
  • [*] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [*] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump

Change contents

  • edit in libpijul/src/apply.rs at line 50
    [8.123233]
    [3.752]
    Corruption,
  • edit in libpijul/src/apply.rs at line 67
    [4.38629]
    [3.811]
    LocalApplyError::Corruption => write!(fmt, "Corruption"),
  • edit in libpijul/src/apply.rs at line 86
    [4.39390]
    [3.888]
    LocalApplyError::Corruption => write!(fmt, "Corruption"),
  • replacement in libpijul/src/apply/vertex.rs at line 113
    [4.94301][4.94301:94393]()
    let introduced_by = txn.get_external(&parent.introduced_by())?.unwrap().into();
    [4.94301]
    [2.2307]
    let introduced_by = if let Some(i) = txn.get_external(&parent.introduced_by())? {
    i.into()
    } else {
    error!("Corruption error in {} at line {}", file!(), line!());
    return Err(LocalApplyError::Corruption)
    };
  • replacement in libpijul/src/apply/vertex.rs at line 161
    [4.95833][4.95833:95929]()
    let introduced_by = txn.get_external(&parent.introduced_by())?.unwrap().into();
    [4.95833]
    [4.95929]
    let introduced_by = if let Some(i) = txn.get_external(&parent.introduced_by())? {
    i.into()
    } else {
    error!("Corruption error in {} at line {}", file!(), line!());
    return Err(LocalApplyError::Corruption)
    };