您最多能選擇 25 個主題
主題必須以字母或數字為開頭,可包含連接號「-」且最長為 35 個字元。
16 行
380 B
16 行
380 B
4 年前
|
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="; ")
|
||
|
)
|
||
|
)
|
||
|
}
|
||
|
|
||
|
}
|