Skip to content

Commit

Permalink
Move error codes inside Error class
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Aug 26, 2013
1 parent 23f0161 commit e07c442
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
16 changes: 16 additions & 0 deletions lib/twitter/error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ module Twitter
class Error < StandardError
attr_reader :rate_limit, :wrapped_exception, :code

# If error code is missing see https://dev.twitter.com/docs/error-codes-responses
module Codes
AUTHENTICATION_PROBLEM = 32
RESOURCE_NOT_FOUND = 34
SUSPENDED_ACCOUNT = 64
DEPRECATED_CALL = 68
RATE_LIMIT_EXCEEDED = 88
INVALID_OR_EXPIRED_TOKEN = 89
OVER_CAPACITY = 130
INTERNAL_ERROR = 131
OAUTH_TIMESTAMP_OUT_OF_RANGE = 135
DUPLICATE_STATUS = 187
BAD_AUTHENTICATION_DATA = 215
LOGIN_VERIFICATION_NEEDED = 231
end

# Create a new error from an HTTP response
#
# @param response [Hash]
Expand Down
17 changes: 0 additions & 17 deletions lib/twitter/error_codes.rb

This file was deleted.

0 comments on commit e07c442

Please sign in to comment.