diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d9f1ead3..e7761b249 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## 0.6.0 (TBD) +* Added better error handling for WASM sync state * Added WASM Input note tests + updated input note models (#554) * Added new variants for the `NoteFilter` struct (#538). * [BREAKING] Added note tags for future notes in `TransactionRequest` (#538). diff --git a/crates/web-client/package.json b/crates/web-client/package.json index 23723e8db..eacaddf27 100644 --- a/crates/web-client/package.json +++ b/crates/web-client/package.json @@ -1,6 +1,6 @@ { "name": "@demox-labs/miden-sdk", - "version": "0.0.14", + "version": "0.0.15", "description": "Polygon Miden Wasm SDK", "collaborators": [ "Polygon Miden", diff --git a/crates/web-client/src/sync.rs b/crates/web-client/src/sync.rs index 6d526e0e4..79e8db0fb 100644 --- a/crates/web-client/src/sync.rs +++ b/crates/web-client/src/sync.rs @@ -6,7 +6,10 @@ use crate::{models::sync_summary::SyncSummary, WebClient}; impl WebClient { pub async fn sync_state(&mut self) -> Result { if let Some(client) = self.get_mut_inner() { - let sync_summary = client.sync_state().await.unwrap(); + let sync_summary = client + .sync_state() + .await + .map_err(|err| JsValue::from_str(&format!("Failed to sync state: {}", err)))?; Ok(sync_summary.into()) } else {