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

Error messages not always clear or accurate #19

Open
skearns64 opened this issue Jul 18, 2015 · 1 comment
Open

Error messages not always clear or accurate #19

skearns64 opened this issue Jul 18, 2015 · 1 comment
Assignees

Comments

@skearns64
Copy link

Leading up to filing #18, I discovered that the keyword property does not support a *. However, instead of a rejection, syntax error, or even "bad request", the error shown when --debug was enabled was Twitter::Error::Unauthorized.

The plugin should include the best possible error message and as much information as possible. I believe the response codes from the twitter API have additional information that could be returned [1].

[1] https://dev.twitter.com/overview/api/response-codes

@purbon
Copy link

purbon commented Nov 9, 2015

The gem we use this days, the https://github.com/sferik/twitter is already doing what you request. It creates the error string based on the twitter response code.

      def on_headers_complete(_headers)
        error = Twitter::Error::ERRORS[@parser.status_code]
        fail error if error
      end

https://github.com/sferik/twitter/blob/925baa293ae3cb692b6a36be7cc9c5a39dff73c4/lib/twitter/streaming/response.rb#L22-L25 && https://github.com/sferik/twitter/blob/925baa293ae3cb692b6a36be7cc9c5a39dff73c4/lib/twitter/error.rb#L59-L71

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

No branches or pull requests

3 participants