Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How are custom error handlers supposed to be implemented whilst using PublicStreamFilter? #185

Open
bradkyle opened this issue May 12, 2017 · 3 comments

Comments

@bradkyle
Copy link

bradkyle commented May 12, 2017

I am trying to create a custom error handler for the PublicStreamFilter function, more specifically I would like to log the rate limit errors to a file in the same directory. But the PublicStreamFilter function doesn't return an error. Does this mean that the PublicStreamFilter doesn't incur any errors?

Thus, how are custom error handling functions supposed to be implemented with the PublicStreamFilter function in use(streaming being the current objective)?

There is no explicit documentation in the godocs or implementation in the example_test.go .

@bradkyle bradkyle changed the title How are custom errors supposed to be implemented whilst using PublicStreamFilter? How are custom error handlers supposed to be implemented whilst using PublicStreamFilter? May 13, 2017
@gnobre
Copy link

gnobre commented Jul 24, 2017

PublicStreamFilter returns a anaconda.LimitNotice with the number of undelivered tweets

@cesarsalgado
Copy link

cesarsalgado commented Sep 5, 2017

I think the Stream struct should have an error channel and an status channel so the client code can possibly act upon the error or status code. For example, one can imagine a client code that wants to stop the stream upon the 420, instead of the default anaconda behavior that is to keep trying with exponential backoff.

Currently the only way to act upon an error is by creating your own Logger implementation that forward the messages received to channels and passing the logger to the TwitterApi struct upon creation. But this is not a very elegant solution.

I can make a pull request if there is interest in adopting this solution.

@jnflint
Copy link

jnflint commented Apr 6, 2018

@cesarsalgado I'd be interested in such a solution.
As I understand the issue it is not possible/practical to get notification of the http status codes or errors that occur. I'd like to get this information so I could for instance, get missing tweets through the search api.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants