Cesar Rodas 1 settimana fa
parent
commit
e465a87b92
1 ha cambiato i file con 16 aggiunte e 3 eliminazioni
  1. 16 3
      crates/cdk-sqlite/src/mint/async_rusqlite.rs

+ 16 - 3
crates/cdk-sqlite/src/mint/async_rusqlite.rs

@@ -300,7 +300,10 @@ fn rusqlite_worker_manager(
                             tracing::trace!("Tx {}: Commit", tx_id);
                             tracing::trace!("Tx {}: Commit", tx_id);
                             let _ = reply_to.send(match tx.commit() {
                             let _ = reply_to.send(match tx.commit() {
                                 Ok(()) => DbResponse::Ok,
                                 Ok(()) => DbResponse::Ok,
-                                Err(err) => DbResponse::Error(err.into()),
+                                Err(err) => {
+                                    tracing::error!("Failed commit {:?}", err);
+                                    DbResponse::Error(err.into())
+                                }
                             });
                             });
                             break;
                             break;
                         }
                         }
@@ -308,7 +311,10 @@ fn rusqlite_worker_manager(
                             tracing::trace!("Tx {}: Rollback", tx_id);
                             tracing::trace!("Tx {}: Rollback", tx_id);
                             let _ = reply_to.send(match tx.rollback() {
                             let _ = reply_to.send(match tx.rollback() {
                                 Ok(()) => DbResponse::Ok,
                                 Ok(()) => DbResponse::Ok,
-                                Err(err) => DbResponse::Error(err.into()),
+                                Err(err) => {
+                                    tracing::error!("Failed rollback {:?}", err);
+                                    DbResponse::Error(err.into())
+                                }
                             });
                             });
                             break;
                             break;
                         }
                         }
@@ -319,7 +325,14 @@ fn rusqlite_worker_manager(
                             tracing::trace!("Tx {}: SQL {}", tx_id, sql.sql);
                             tracing::trace!("Tx {}: SQL {}", tx_id, sql.sql);
                             let _ = match process_query(&tx, sql) {
                             let _ = match process_query(&tx, sql) {
                                 Ok(ok) => reply_to.send(ok),
                                 Ok(ok) => reply_to.send(ok),
-                                Err(err) => reply_to.send(DbResponse::Error(err)),
+                                Err(err) => {
+                                    tracing::error!(
+                                        "Tx {}: Failed query with error {:?}",
+                                        tx_id,
+                                        err
+                                    );
+                                    reply_to.send(DbResponse::Error(err))
+                                }
                             };
                             };
                         }
                         }
                     }
                     }