Add TransportWorker and enhance logging: Introduced TransportWorker to the worker module and improved shutdown logging in the daemon for better visibility during system termination. Updated watchdog thread sleep mechanism for quicker shutdown response and refined error handling in DbError conversion to include SQLSTATE as a string.

This commit is contained in:
Torsten Schulz (local)
2025-11-26 16:03:27 +01:00
parent 25f2eb150d
commit 8ee0bbf3cd
5 changed files with 499 additions and 6 deletions

View File

@@ -33,7 +33,8 @@ impl std::error::Error for DbError {}
impl From<PgError> for DbError {
fn from(err: PgError) -> Self {
if let Some(db_err) = err.as_db_error() {
let code = db_err.code();
// SQLSTATE als String extrahieren (z.B. "23514")
let code = db_err.code().code().to_string();
let message = db_err.message();
let detail = db_err.detail().unwrap_or_default();
let hint = db_err.hint().unwrap_or_default();