mirror of
https://github.com/samsonjs/instapaper.git
synced 2026-03-25 08:55:49 +00:00
remove connection_options
This commit is contained in:
parent
9661c2b879
commit
62098418d6
2 changed files with 40 additions and 5 deletions
|
|
@ -17,7 +17,7 @@ module Instapaper
|
|||
:oauth_token_secret,
|
||||
:proxy,
|
||||
:user_agent,
|
||||
:connection_options].freeze
|
||||
].freeze
|
||||
|
||||
# By default, don't set an application key
|
||||
DEFAULT_CONSUMER_KEY = nil
|
||||
|
|
@ -40,8 +40,6 @@ module Instapaper
|
|||
# The user agent that will be sent to the API endpoint if none is set
|
||||
DEFAULT_USER_AGENT = "Instapaper Ruby Gem #{Instapaper::VERSION}".freeze
|
||||
|
||||
DEFAULT_CONNECTION_OPTIONS = {}
|
||||
|
||||
# @private
|
||||
attr_accessor :consumer_key
|
||||
attr_accessor :consumer_secret
|
||||
|
|
@ -50,7 +48,6 @@ module Instapaper
|
|||
attr_accessor :oauth_token_secret
|
||||
attr_accessor :proxy
|
||||
attr_accessor :user_agent
|
||||
attr_accessor :connection_options
|
||||
|
||||
# Creates a new Instapaper::Client
|
||||
def initialize(options = {})
|
||||
|
|
@ -97,7 +94,6 @@ module Instapaper
|
|||
@oauth_token_secret = DEFAULT_OAUTH_TOKEN_SECRET
|
||||
@proxy = DEFAULT_PROXY
|
||||
@user_agent = DEFAULT_USER_AGENT
|
||||
@connection_options = DEFAULT_CONNECTION_OPTIONS
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,4 +1,43 @@
|
|||
module Instapaper
|
||||
# Custom error class for rescuing from all Instapaper errors
|
||||
class Error < StandardError
|
||||
# @return [Integer]
|
||||
attr_reader :code
|
||||
|
||||
# RateLimitExceeded = Class.new(self)
|
||||
# PremiumAccountRequired = Class.new(self)
|
||||
# SuspendedApplication = Class.new(self)
|
||||
#
|
||||
# # 1040: Rate-limit exceeded
|
||||
# # 1041: Premium account required
|
||||
# # 1042: Application is suspended
|
||||
#
|
||||
# BookmarkError = Class.new(self)
|
||||
#
|
||||
# Bookmark errors:
|
||||
#
|
||||
# 1220: Domain requires full content to be supplied
|
||||
# 1221: Domain has opted out of Instapaper compatibility
|
||||
# 1240: Invalid URL specified
|
||||
# 1241: Invalid or missing bookmark_id
|
||||
# 1242: Invalid or missing folder_id
|
||||
# 1243: Invalid or missing progress
|
||||
# 1244: Invalid or missing progress_timestamp
|
||||
# 1245: Private bookmarks require supplied content
|
||||
# 1250: Unexpected error when saving bookmark
|
||||
# Folder errors:
|
||||
#
|
||||
# 1250: Invalid or missing title
|
||||
# 1251: User already has a folder with this title
|
||||
# 1252: Cannot add bookmarks to this folder
|
||||
# Operational errors:
|
||||
#
|
||||
# 1500: Unexpected service error
|
||||
# 1550: Error generating text version of this URL
|
||||
# Highlight Errors:
|
||||
#
|
||||
# 1600: Cannot create highlight with empty text
|
||||
# 1601: Duplicate highlight
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue