Add http status code to error message

Change-Id: If3123b997a7e71560ae3f80488694f7dbf5a5ac2
diff --git a/R/matomoquery.R b/R/matomoquery.R
index e530d4b..8d2ec02 100644
--- a/R/matomoquery.R
+++ b/R/matomoquery.R
@@ -67,7 +67,7 @@
   ) -> res
 
   if (status_code(res) != 200) {
-    stop(paste("API call failed:", httr::content(res, "text", encoding = "UTF-8")), call. = FALSE)
+    stop(paste("API call failed with status", status_code(res), ":", httr::content(res, "text", encoding = "UTF-8")), call. = FALSE)
   }
 
   if (!http_type(res) %in% c("application/json", "application/ld+json")) {