Learn R Programming

elasticsearchr (version 0.3.1)

check_http_code_throw_error: HTTP response error handling.

Description

If an HTTP request returns a status code that is not 200, then this functions throws an exception and prints the prettified response contents to stderr.

Usage

check_http_code_throw_error(response)

Arguments

response

An HTTP response from a request to a search API request.

Value

Exception with prettified JSON response printed to stderr.