Skip to content

Commit b3864f8

Browse files
authored
fix: handle all empty responses in filter (#1688)
1 parent 9593a8a commit b3864f8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/core/src/lib/filter/index.ts

+12
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,12 @@ class Subscription {
184184
async (source) => await all(source)
185185
);
186186

187+
if (!res || !res.length) {
188+
throw Error(
189+
`No response received for request ${request.requestId}: ${res}`
190+
);
191+
}
192+
187193
const { statusCode, requestId, statusDesc } =
188194
FilterSubscribeResponse.decode(res[0].slice());
189195

@@ -216,6 +222,12 @@ class Subscription {
216222
async (source) => await all(source)
217223
);
218224

225+
if (!res || !res.length) {
226+
throw Error(
227+
`No response received for request ${request.requestId}: ${res}`
228+
);
229+
}
230+
219231
const { statusCode, requestId, statusDesc } =
220232
FilterSubscribeResponse.decode(res[0].slice());
221233

0 commit comments

Comments
 (0)