Skip to content

Commit

Permalink
Merge pull request #17 from fermyon/turso-context-error
Browse files Browse the repository at this point in the history
Add context around SQLite execution errors
  • Loading branch information
kate-goldenring authored Nov 8, 2024
2 parents 0242b0f + c61c900 commit 54129ce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mqtt-message-persister/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use anyhow::Context;
use chrono::{DateTime, Utc};
use spin_mqtt_sdk::{mqtt_component, Metadata, Payload};
use spin_sdk::sqlite::{Connection, Value};
Expand Down Expand Up @@ -34,7 +35,7 @@ async fn handle_message(message: Payload, metadata: Metadata) -> anyhow::Result<
connection.execute(
"INSERT INTO noise_log (source, volume, timestamp) VALUES (?, ?, ?)",
execute_params.as_slice(),
)?;
).context("failed to insert entry into noise_log")?;
}
Ok(())
}

0 comments on commit 54129ce

Please sign in to comment.