mirror of
https://github.com/facebook/sapling.git
synced 2024-10-12 01:39:21 +03:00
bundle2-resolver: add context to errors when decoding filelogs
Summary: more context, better errors Reviewed By: farnz Differential Revision: D8298947 fbshipit-source-id: bc950ca39b8fc010f3a225f0810e13f62d6efa24
This commit is contained in:
parent
c90ee251ab
commit
5220fc66de
@ -123,18 +123,29 @@ where
|
||||
|
||||
delta_cache
|
||||
.decode(node.clone(), base.into_option(), delta)
|
||||
.and_then(move |data| {
|
||||
Ok(Filelog {
|
||||
node_key: HgNodeKey {
|
||||
path: RepoPath::FilePath(path),
|
||||
hash: node,
|
||||
},
|
||||
p1: p1.into_option(),
|
||||
p2: p2.into_option(),
|
||||
linknode,
|
||||
data,
|
||||
})
|
||||
.and_then({
|
||||
let node = node.clone();
|
||||
let path = path.clone();
|
||||
move |data| {
|
||||
Ok(Filelog {
|
||||
node_key: HgNodeKey {
|
||||
path: RepoPath::FilePath(path),
|
||||
hash: node,
|
||||
},
|
||||
p1: p1.into_option(),
|
||||
p2: p2.into_option(),
|
||||
linknode,
|
||||
data,
|
||||
})
|
||||
}
|
||||
})
|
||||
.with_context(move |_| {
|
||||
format!(
|
||||
"While decoding delta cache for file id {}, path {}",
|
||||
node, path
|
||||
)
|
||||
})
|
||||
.from_err()
|
||||
.boxify()
|
||||
})
|
||||
.boxify()
|
||||
|
@ -4,7 +4,7 @@
|
||||
// This software may be used and distributed according to the terms of the
|
||||
// GNU General Public License version 2 or any later version.
|
||||
|
||||
pub use failure::{Error, Result, ResultExt};
|
||||
pub use failure::prelude::*;
|
||||
|
||||
use mercurial_types::HgNodeHash;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user