mirror of https://git.sr.ht/~hrbrmstr/splashr
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
380 B
16 lines
380 B
4 years ago
|
check_or_report_status <- function(res) {
|
||
|
|
||
|
if (httr::status_code(res) >= 400) {
|
||
|
msg <- httr::content(res, as="text", encoding="UTF-8")
|
||
|
msg <- jsonlite::fromJSON(msg)
|
||
|
httr::stop_for_status(
|
||
|
x = res,
|
||
|
task = sprintf(
|
||
|
fmt = "render due to %s",
|
||
|
paste0(c(msg[["type"]], msg[["description"]], msg[["info"]]), collapse="; ")
|
||
|
)
|
||
|
)
|
||
|
}
|
||
|
|
||
|
}
|