def check_roads_body_error(response, body)
        error = body[:error]
        return unless error

        case error[:status]
          when 'INVALID_ARGUMENT'
            if error[:message] == 'The provided API key is invalid.'
              raise GoogleMapsService::Error::RequestDeniedError.new(response), error[:message]
            end
            raise GoogleMapsService::Error::InvalidRequestError.new(response), error[:message]
          when 'PERMISSION_DENIED'
            raise GoogleMapsService::Error::RequestDeniedError.new(response), error[:message]
          when 'RESOURCE_EXHAUSTED'
            raise GoogleMapsService::Error::RateLimitError.new(response), error[:message]
          else
            raise GoogleMapsService::Error::ApiError.new(response), error[:message]
        end
      end
def check_roads_body_error(response, body)
        error = body[:error]
        return unless error

        case error[:status]
          when 'INVALID_ARGUMENT'
            if error[:message] == 'The provided API key is invalid.'
              raise GoogleMapsService::Error::RequestDeniedError.new(response), error[:message]
            end
            raise GoogleMapsService::Error::InvalidRequestError.new(response), error[:message]
          when 'PERMISSION_DENIED'
            raise GoogleMapsService::Error::RequestDeniedError.new(response), error[:message]
          when 'RESOURCE_EXHAUSTED'
            raise GoogleMapsService::Error::RateLimitError.new(response), error[:message]
          else
            raise GoogleMapsService::Error::ApiError.new(response), error[:message]
        end
      end
Check response body for error status.

 @param [Hurley::Response] response Response object.
 @param [Hash] body Response body.