Class: ShopifyGraphql::ConnectionError
- Inherits:
-
ShopifyAPI::Errors::HttpResponseError
- Object
- ShopifyAPI::Errors::HttpResponseError
- ShopifyGraphql::ConnectionError
- Defined in:
- lib/shopify_graphql/exceptions.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#error_code ⇒ Object
Returns the value of attribute error_code.
-
#fields ⇒ Object
Returns the value of attribute fields.
Instance Method Summary collapse
-
#initialize(response: nil) ⇒ ConnectionError
constructor
A new instance of ConnectionError.
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_code ⇒ Object
Returns the value of attribute error_code.
3 4 5 |
# File 'lib/shopify_graphql/exceptions.rb', line 3 def error_code @error_code end |
#fields ⇒ Object
Returns the value of attribute fields.
3 4 5 |
# File 'lib/shopify_graphql/exceptions.rb', line 3 def fields @fields end |