sc_last_error | R Documentation |
In case API requests are unsuccessful, STATcubeR
will throw errors
to summarize the httr error type and its meaning.
Requests are considered unsuccessful if one of the following applies
The response returns TRUE
for httr::http_error()
.
The response is not of type "application/json"
In some cases it is useful to get direct access to a faulty response object.
For that purpose, it is possible to use sc_last_error()
which will provide
the httr response object for the last unsuccessful request.
sc_last_error()
sc_last_error_parsed()
The return value from httr::GET()
or httr::POST()
.
sc_last_error_parsed()
: returns the last error as a list containing
the response content and the response status
try(sc_table_saved("invalid_id"))
last_error <- sc_last_error()
httr::content(last_error)
str(sc_last_error_parsed())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.