# Raised when to delete an already-deleted object.
class APIAlreadyDeletedError < APIError
- def initialize(object = "object", object_id = "")
- @object = object
- @object_id = object_id
+ def initialize(type = "object", id = "")
+ @type = type
+ @id = id
- super("The #{object} with the id #{object_id} has already been deleted")
+ super("The #{type} with the id #{id} has already been deleted")
end
- attr_reader :object, :object_id
+ attr_reader :type, :id
def status
:gone
# Return the HTTP client to use
def self.http_client
- @http_client ||= Faraday.new(:request => { :timeout => 15 })
+ @http_client ||= Faraday.new(:request => { :timeout => 15 },
+ :headers => { :user_agent => Settings.server_url })
end
# Return the MaxMindDB database handle