Tools to Work with the 'Splash' JavaScript Rendering Service in R
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
380B

  1. check_or_report_status <- function(res) {
  2. if (httr::status_code(res) >= 400) {
  3. msg <- httr::content(res, as="text", encoding="UTF-8")
  4. msg <- jsonlite::fromJSON(msg)
  5. httr::stop_for_status(
  6. x = res,
  7. task = sprintf(
  8. fmt = "render due to %s",
  9. paste0(c(msg[["type"]], msg[["description"]], msg[["info"]]), collapse="; ")
  10. )
  11. )
  12. }
  13. }