From 6f63ded5c107f4400ea0e537a9cfd3e60275ef52 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Fri, 23 Feb 2024 13:28:08 +0000 Subject: [PATCH] [audit] Handle errors when fetching storage keys from Unstablebackend (#1440) * Handle errors when fetching storage keys from Unstablebackend * cargo fmt --- subxt/src/backend/unstable/storage_items.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/subxt/src/backend/unstable/storage_items.rs b/subxt/src/backend/unstable/storage_items.rs index 73790765ea..20464236cd 100644 --- a/subxt/src/backend/unstable/storage_items.rs +++ b/subxt/src/backend/unstable/storage_items.rs @@ -150,6 +150,11 @@ impl Stream for StorageItems { self.buffered_responses = items.items; continue; } + FollowEvent::OperationError(err) if err.operation_id == *self.operation_id => { + // Something went wrong obtaining storage items; mark as done and return the error. + self.done = true; + return Poll::Ready(Some(Err(Error::Other(err.error)))); + } _ => { // We don't care about this event; wait for the next. continue;