Skip to content

Commit

Permalink
Add debug message
Browse files Browse the repository at this point in the history
  • Loading branch information
eatradish committed Feb 13, 2025
1 parent aac2b31 commit efd168d
Showing 1 changed file with 23 additions and 12 deletions.
35 changes: 23 additions & 12 deletions oma-history/src/migrations.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use oma_pm_operation_type::{InstallOperation, RemoveTag};
use rusqlite::Connection;
use serde::Deserialize;
use tracing::info;
use tracing::{info, warn};

use crate::{
HistoryEntryInner, HistoryError, HistoryResult, InstallHistoryEntry, RemoveHistoryEntry,
Expand Down Expand Up @@ -215,19 +215,30 @@ fn get_old_table(conn: &Connection) -> Result<Vec<OldTableEntry>, HistoryError>
summary_type,
) = i.map_err(HistoryError::ExecuteError)?;

let Ok(install_packages) =
serde_json::from_str::<Vec<InstallHistoryEntry>>(&install_packages)
else {
continue;
};
let install_packages =
match serde_json::from_str::<Vec<InstallHistoryEntry>>(&install_packages) {
Ok(i) => i,
Err(e) => {
warn!("Failed to parse item: {e}");
continue;
}
};

let Ok(summary_type) = serde_json::from_str::<OldSummaryType>(&summary_type) else {
continue;
};
let remove_packages =
match serde_json::from_str::<Vec<RemoveHistoryEntry>>(&remove_packages) {
Ok(i) => i,
Err(e) => {
warn!("Failed to parse item: {e}");
continue;
}
};

let Ok(remove_packages) = serde_json::from_str::<Vec<RemoveHistoryEntry>>(&remove_packages)
else {
continue;
let summary_type = match serde_json::from_str::<OldSummaryType>(&summary_type) {
Ok(s) => s,
Err(e) => {
warn!("Failed to parse item: {e}");
continue;
}
};

res.push(OldTableEntry {
Expand Down

0 comments on commit efd168d

Please sign in to comment.