cli: Log errors when COBs can't load
This commit is contained in:
parent
2b75045661
commit
bfc949d094
|
|
@ -306,9 +306,13 @@ where
|
|||
} = match &n.kind {
|
||||
NotificationKind::Branch { name } => NotificationRow::branch(name, head, &n, &repo)?,
|
||||
NotificationKind::Cob { typed_id } => {
|
||||
match NotificationRow::cob(typed_id, &n, &issues, &patches, &repo)? {
|
||||
Some(row) => row,
|
||||
None => continue,
|
||||
match NotificationRow::cob(typed_id, &n, &issues, &patches, &repo) {
|
||||
Ok(Some(row)) => row,
|
||||
Ok(None) => continue,
|
||||
Err(e) => {
|
||||
log::error!(target: "cli", "Error loading notification for {typed_id}: {e}");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
NotificationKind::Unknown { refname } => {
|
||||
|
|
|
|||
|
|
@ -632,9 +632,13 @@ where
|
|||
let mut all = Vec::new();
|
||||
let issues = cache.list()?;
|
||||
for result in issues {
|
||||
let Ok((id, issue)) = result else {
|
||||
// Skip issues that failed to load.
|
||||
continue;
|
||||
let (id, issue) = match result {
|
||||
Ok((id, issue)) => (id, issue),
|
||||
Err(e) => {
|
||||
// Skip issues that failed to load.
|
||||
log::error!(target: "cli", "Issue load error: {e}");
|
||||
continue;
|
||||
}
|
||||
};
|
||||
|
||||
if let Some(a) = assignee {
|
||||
|
|
|
|||
|
|
@ -29,9 +29,13 @@ pub fn run(
|
|||
None => patches.list()?,
|
||||
};
|
||||
for patch in iter {
|
||||
let Ok((id, patch)) = patch else {
|
||||
// Skip patches that failed to load.
|
||||
continue;
|
||||
let (id, patch) = match patch {
|
||||
Ok((id, patch)) => (id, patch),
|
||||
Err(e) => {
|
||||
// Skip patches that failed to load.
|
||||
log::error!(target: "cli", "Patch load error: {e}");
|
||||
continue;
|
||||
}
|
||||
};
|
||||
if !authors.is_empty() {
|
||||
if !authors.contains(patch.author().id()) {
|
||||
|
|
|
|||
|
|
@ -29,6 +29,12 @@ pub struct TypedId {
|
|||
pub type_name: TypeName,
|
||||
}
|
||||
|
||||
impl std::fmt::Display for TypedId {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(f, "{}/{}", self.type_name, self.id)
|
||||
}
|
||||
}
|
||||
|
||||
/// Errors that occur when parsing a Git refname into a [`TypedId`].
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum ParseIdentifierError {
|
||||
|
|
|
|||
Loading…
Reference in New Issue