Error cleanup in libpijul

[?]
May 27, 2021, 10:05 AM
5GYRDN47UOT5BSCUID7VLDPI47KILTKGIHKG3AXMDPCTSHKKDB5AC

Dependencies

  • [2] PJ7T2VFL Do not hang on locked repositories
  • [3] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [4] BZSC7VMY address clippy lints
  • [5] BUM5P4VG Correct error for Merkle::from_base32
  • [6] YN63NUZO Sanakirja 1.0

Change contents

  • replacement in libpijul/src/pristine/merkle.rs at line 83
    [3.640970][3.640970:640999]()
    type Err = crate::Error;
    [3.640970]
    [3.640999]
    type Err = crate::ParseError;
  • replacement in libpijul/src/pristine/merkle.rs at line 88
    [3.641147][3.641147:641210]()
    Err(crate::Error::ParseError { s: s.to_string() })
    [3.641147]
    [3.641210]
    Err(crate::ParseError { s: s.to_string() })
  • replacement in libpijul/src/pristine/hash.rs at line 134
    [3.648294][3.648294:648323]()
    type Err = crate::Error;
    [3.648294]
    [3.648323]
    type Err = crate::ParseError;
  • replacement in libpijul/src/pristine/hash.rs at line 139
    [3.648471][3.648471:648534]()
    Err(crate::Error::ParseError { s: s.to_string() })
    [3.648471]
    [3.648534]
    Err(crate::ParseError { s: s.to_string() })
  • replacement in libpijul/src/lib.rs at line 40
    [3.717996][3.717996:720083](),[3.720083][2.880:961]()
    pub enum Error {
    #[error("File {:?} already in repository", path)]
    FileAlreadyInRepo { path: String },
    #[error("File {:?} not in repository", path)]
    FileNotInRepo { path: String },
    #[error("Cannot record from unrecorded prefix {:?}", path)]
    UnrecordedPath { path: String },
    #[error("File {:?} not found", path)]
    FileNotFound { path: String },
    #[error("Change not on channel {:?}", change_id)]
    ChangeNotOnChannel { change_id: pristine::ChangeId },
    #[error("Change is depended upon {:?}", change_id)]
    ChangeIsDependedUpon { change_id: pristine::ChangeId },
    #[error("Change not found: {:?}", hash)]
    ChangeNotFound { hash: String },
    #[error("State not found: {:?}", state)]
    StateNotFound { state: pristine::Merkle },
    #[error("Change hash mismatch: {:?} != {:?}", claimed, computed)]
    ChangeHashMismatch {
    claimed: pristine::Hash,
    computed: pristine::Hash,
    },
    #[error("Contents hash mismatch: {:?} != {:?}", claimed, computed)]
    ContentsHashMismatch {
    claimed: pristine::Hash,
    computed: pristine::Hash,
    },
    #[error("Change already on channel: {:?}", hash)]
    ChangeAlreadyOnChannel { hash: pristine::Hash },
    #[error("Dependency missing: {:?}", hash)]
    DependencyMissing { hash: pristine::Hash },
    #[error("Channel name already taken: {:?}", name)]
    ChannelNameExists { name: String },
    #[error("Parse error: {:?}", s)]
    ParseError { s: String },
    #[error("Verify error, public key = {:?}", pk)]
    VerifyError { pk: String },
    #[error("Ambiguous hash prefix: {}", prefix)]
    AmbiguousHashPrefix { prefix: String },
    #[error("Inconsistent references in change")]
    InconsistentChange,
    #[error("Missing change contents: {}", hash)]
    MissingContents { hash: String },
    #[error("Wrong block: {:?}", block)]
    WrongBlock {
    block: pristine::Position<pristine::ChangeId>,
    },
    #[error("Pristine corrupt")]
    PristineCorrupt,
    #[error("Change version mismatch, please run `pijul upgrade`.")]
    VersionMismatch,
    #[error("The repository is locked by another process.")]
    PristineLocked,
    [3.717996]
    [3.720083]
    #[error("Parse error: {:?}", s)]
    pub struct ParseError { s: String }
    #[derive(Debug, Error, Serialize, Deserialize)]
    pub enum RemoteError {
    #[error("Repository not found: {}", url)]
    RepositoryNotFound { url: String },
    #[error("Channel {} not found for repository {}", channel, url)]
    ChannelNotFound { channel: String, url: String },
    #[error("Ambiguous path: {}", path)]
    AmbiguousPath { path: String },
    #[error("Path not found: {}", path)]
    PathNotFound { path: String },
    #[error("Change not found: {}", change)]
    ChangeNotFound { change: String },