Class: ShopifyGraphql::ConnectionError

Inherits:
ShopifyAPI::Errors::HttpResponseError
  • Object
show all
Defined in:
lib/shopify_graphql/exceptions.rb

Direct Known Subclasses

ClientError, ServerError, UserError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response: nil) ⇒ ConnectionError

Returns a new instance of ConnectionError.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/shopify_graphql/exceptions.rb', line 5

def initialize(response: nil)
  unless response
    empty_response = ShopifyAPI::Clients::HttpResponse.new(code: 200, headers: {}, body: "")
    super(response: empty_response) and return
  end

  if response.is_a?(ShopifyAPI::Clients::HttpResponse)
    super(response: response)
  else
    response = ShopifyAPI::Clients::HttpResponse.new(
      code: 200,
      headers: {},
      body: response
    )
    super(response: response)
  end
end

Instance Attribute Details

#error_codeObject

Returns the value of attribute error_code.



3
4
5
# File 'lib/shopify_graphql/exceptions.rb', line 3

def error_code
  @error_code
end

#fieldsObject

Returns the value of attribute fields.



3
4
5
# File 'lib/shopify_graphql/exceptions.rb', line 3

def fields
  @fields
end