Class: GoogleMobileFriendly::ResponseData::TestStatus

Inherits:
Object
  • Object
show all
Defined in:
lib/google_mobile_friendly/response_data/test_status.rb

Constant Summary collapse

TEST_STATUS_UNSPECIFIED =
"Internal error when running this test. Please try running the test again."
COMPLETE =
"Inspection has completed without errors."
INTERNAL_ERROR =
"Inspection terminated in an error state. This indicates a problem in\nGoogle's infrastructure, not a user error. Please try again later."
PAGE_UNREACHABLE =
"Google can not access the URL because of a user error such as a robots.txt\nblockage, a 403 or 500 code etc. Please make sure that the URL provided is\naccessible by Googlebot and is not password protected."

Class Method Summary collapse

Class Method Details

.raise_if_response_is_bad(response) ⇒ Object



9
10
11
12
# File 'lib/google_mobile_friendly/response_data/test_status.rb', line 9

def self.raise_if_response_is_bad response
  return if response[:testStatus][:status] == "COMPLETE"
  raise MobileFriendlyAPIError.new(self.const_get response[:testStatus][:status])
end