You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some chunks coming from the stream API look like the example below.
First, would it make sense to report whatever is coming in .errors[] as TwitterError?
Second, would the code become more elegant by disconnecting explicitly on receiving OperationalDisconnect?
constchunk={errors: [{title: 'operational-disconnect',disconnect_type: 'OperationalDisconnect',detail: 'This stream has been disconnected for operational reasons.',type: 'https://api.twitter.com/2/problems/operational-disconnect',},],}
Motivation
My code was naively expecting to receive consistently formed chunks and errored out on this unexpected shape. Which is kind of fine, but since this is an explicit error, it probably would make sense to centralize its handling in the twitter-v2.
Describe alternatives you've considered
Leaving this for all library users to handle by themselves is also an option, a wasteful one though.
Additional context
The text was updated successfully, but these errors were encountered:
Prerequisites
following:
Summary
Some chunks coming from the stream API look like the example below.
First, would it make sense to report whatever is coming in
.errors[]
asTwitterError
?Second, would the code become more elegant by disconnecting explicitly on receiving
OperationalDisconnect
?Motivation
My code was naively expecting to receive consistently formed chunks and errored out on this unexpected shape. Which is kind of fine, but since this is an explicit error, it probably would make sense to centralize its handling in the twitter-v2.
Describe alternatives you've considered
Leaving this for all library users to handle by themselves is also an option, a wasteful one though.
Additional context
The text was updated successfully, but these errors were encountered: