From 0436208a9c476bc5f35fcfa7eab0c482ee1fadd4 Mon Sep 17 00:00:00 2001 From: "Jennifer (Jenny) Bryan" Date: Tue, 6 Nov 2018 18:59:39 -0800 Subject: [PATCH] Fail better if imgur upload doesn't work (#1631) --- R/utils-upload.R | 1 + 1 file changed, 1 insertion(+) diff --git a/R/utils-upload.R b/R/utils-upload.R index 0fb17faff2..be6d395d32 100644 --- a/R/utils-upload.R +++ b/R/utils-upload.R @@ -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