Exception: ZombieBattleground::Api::Errors::InvalidResponse

Inherits:
StandardError
  • Object
show all
Defined in:
lib/zombie_battleground/api/errors.rb

Overview

Creates an error with the Faraday response and the context for the error

Instance Method Summary collapse

Constructor Details

#initialize(response, context) ⇒ ZombieBattleground::Api::Errors::InvalidResponse

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Creates an exception class with the Faraday response and error context

Parameters:

  • response (Faraday::Response)

    response from the endpoint

  • context (Class)

    parsed response object



44
45
46
47
48
# File 'lib/zombie_battleground/api/errors.rb', line 44

def initialize(response, context)
  @response = response
  @context = context
  super(context.errors.messages.to_s)
end