From 0619b35a39599b0a057fc2b94672e6795c0c4641 Mon Sep 17 00:00:00 2001 From: Rob Marty Date: Thu, 9 May 2024 17:24:52 -0400 Subject: [PATCH] check bearer --- R/blackmarbler.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/R/blackmarbler.R b/R/blackmarbler.R index 7c7bf05..5775093 100644 --- a/R/blackmarbler.R +++ b/R/blackmarbler.R @@ -466,6 +466,10 @@ download_raster <- function(file_name, message(response) } + if(response$all_headers[[1]]$status != 200){ + message("**Error in downloading data; bearer token likely invalid.** Try regenerating the bearer token; please see this link for instructions to obtain a bearer token: https://github.com/worldbank/blackmarbler?tab=readme-ov-file#bearer-token-") + } + } r <- file_to_raster(download_path,