Source:
R/utils-requests.R
detect_errors.Rd
The requests responses from ArcGIS don't return the status code in the response itself but rather from the body in the json. This function checks for the existence of an error. If an error is found, the contents of the error message are bubbled up.
Usage
detect_errors(response, error_call = rlang::caller_env())
catch_error(response, error_call = rlang::caller_env())
Arguments
- response
for
detect_errors()
, a list typically fromRcppSimdJson::fparse(httr2::resp_body_string(resp))
. Forcatch_error()
, the string fromhttr2::resp_body_string(resp)
.- error_call
default
rlang::caller_env()
. The environment from which to throw the error from.