mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-08 05:52:55 +00:00
turn panic into an error with more details
This commit is contained in:
committed by
Dmitry Rodionov
parent
9ede38b6c4
commit
ff7e9a86c6
@@ -1504,12 +1504,20 @@ impl LayeredTimeline {
|
||||
let ancestor = self
|
||||
.ancestor_timeline
|
||||
.as_ref()
|
||||
.expect("there should be an ancestor")
|
||||
.with_context(|| {
|
||||
format!(
|
||||
"Ancestor is missing. Timeline id: {} Ancestor id {:?}",
|
||||
self.timelineid,
|
||||
self.get_ancestor_timeline_id(),
|
||||
)
|
||||
})?
|
||||
.ensure_loaded()
|
||||
.with_context(|| {
|
||||
format!(
|
||||
"Cannot get the whole layer for read locked: timeline {} is not present locally",
|
||||
self.get_ancestor_timeline_id().unwrap())
|
||||
"Ancestor timeline is not is not loaded. Timeline id: {} Ancestor id {:?}",
|
||||
self.timelineid,
|
||||
self.get_ancestor_timeline_id(),
|
||||
)
|
||||
})?;
|
||||
Ok(Arc::clone(ancestor))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user