View source: R/utils-requests.R
detect_errors | R Documentation |
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.
detect_errors(response, error_call = rlang::caller_env())
catch_error(response, error_call = rlang::caller_env())
response |
for |
error_call |
default |
Nothing. Used for it's side effect. If an error code is encountered in the response an error is thrown with the error code and the error message.
## Not run:
response <- list(
error = list(
code = 400L,
message = "Unable to generate token.",
details = "Invalid username or password."
)
)
detect_errors(response)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.