Skip to content

Commit

Permalink
Add error for subscribe events in transport-grpc
Browse files Browse the repository at this point in the history
  • Loading branch information
jribbink committed Dec 4, 2023
1 parent 10e9f20 commit b2e43f1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/dull-oranges-tell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@onflow/transport-grpc": patch
---

Deprecate @onflow/transport-grpc & add "not implemented" error for subscribeEvents
5 changes: 5 additions & 0 deletions packages/transport-grpc/src/send-grpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ export const send = async (ix, context = {}, opts = {}) => {
return opts.sendPing ? opts.sendPing(ix, context, opts) : sendPing(ix, context, opts)
case context.ix.isGetNetworkParameters(ix):
return opts.sendGetNetworkParameters ? opts.sendGetNetworkParameters(ix, context, opts) : sendGetNetworkParameters(ix, context, opts)
case context.ix.isSubscribeEvents?.(ix):
if (opts.sendSubscribeEvents)
return opts.sendSubscribeEvents(ix, context, opts)
else
throw new Error(`SDK Send Error: subscribeEvents is not supported by this transport.`)
default:
return ix
}
Expand Down

0 comments on commit b2e43f1

Please sign in to comment.