Skip to content

Commit

Permalink
Fail better if imgur upload doesn't work (#1631)
Browse files Browse the repository at this point in the history
  • Loading branch information
jennybc authored and yihui committed Nov 7, 2018
1 parent 6c61415 commit 0436208
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions R/utils-upload.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ imgur_upload = function(file, key = '9f3460e67f308f6') {
config = httr::add_headers(Authorization = paste("Client-ID", key)),
body = list(image = httr::upload_file(file))
)
httr::stop_for_status(resp, "upload to imgur")
res = httr::content(resp, as = "raw")
res = if (length(res)) xml2::as_list(xml2::read_xml(res))
# Breaking change in xml2 1.2.0
Expand Down

0 comments on commit 0436208

Please sign in to comment.