fix: handle all empty responses in filter (#1688)

This commit is contained in:
Vaclav Pavlin 2023-10-26 10:46:08 +02:00 committed by GitHub
parent 9593a8a8a5
commit b3864f8772
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

View File

@ -184,6 +184,12 @@ class Subscription {
async (source) => await all(source)
);
if (!res || !res.length) {
throw Error(
`No response received for request ${request.requestId}: ${res}`
);
}
const { statusCode, requestId, statusDesc } =
FilterSubscribeResponse.decode(res[0].slice());
@ -216,6 +222,12 @@ class Subscription {
async (source) => await all(source)
);
if (!res || !res.length) {
throw Error(
`No response received for request ${request.requestId}: ${res}`
);
}
const { statusCode, requestId, statusDesc } =
FilterSubscribeResponse.decode(res[0].slice());