Class: Parse::Error::ServiceUnavailableError

Inherits:
Error
  • Object
show all
Defined in:
lib/parse/client.rb

Overview

An error when a Parse server (or a gateway in front of it) responds with HTTP 500, 502, 503, or 504.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil) ⇒ ServiceUnavailableError

Returns a new instance of ServiceUnavailableError.



62
63
64
65
# File 'lib/parse/client.rb', line 62

def initialize(message = nil)
  @response = message if message.is_a?(Parse::Response)
  super
end

Instance Attribute Details

#response ⇒ Parse::Response? (readonly)

Returns the response that raised the error.

Returns:



60
61
62
# File 'lib/parse/client.rb', line 60

def response
  @response
end

Instance Method Details

#http_status ⇒ Integer?

Returns the HTTP status of the response, when known.

Returns:

  • (Integer, nil) —

    the HTTP status of the response, when known.



68
69
70
# File 'lib/parse/client.rb', line 68

def http_status
  @response&.http_status&.to_i
end