Skip to content

Commit b31d98e

Browse files
fix: improve error handling in fetch documents
1 parent 94ab4f7 commit b31d98e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

platform-mobile/src/fetch_document.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,10 @@ pub fn fetch_documents_with_query_and_sdk(
103103
tracing::warn!("contract_fetch_result: {:?}", contract);
104104

105105
// Fetch multiple documents so that we get document ID
106-
let mut all_docs_query =
107-
DocumentQuery::new(Arc::clone(&contract), &document_type)
108-
.expect("create SdkDocumentQuery");
106+
let mut all_docs_query = match DocumentQuery::new(Arc::clone(&contract), &document_type) {
107+
Ok(result) => result,
108+
Err(e) => return Err(e.to_string())
109+
};
109110
for wc in where_clauses {
110111
all_docs_query = all_docs_query.with_where(wc);
111112
}

0 commit comments

Comments
 (0)