Skip to content

Commit 008e1f0

Browse files
committed
Add request url to error message for easier debugging (#216)
1 parent 01a54ee commit 008e1f0

4 files changed

Lines changed: 15 additions & 7 deletions

File tree

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: weathercan
22
Type: Package
33
Title: Download Weather Data from Environment and Climate Change Canada
4-
Version: 1.0.0
4+
Version: 1.0.1
55
Authors@R: c(
66
person("Steffi", "LaZerte", email = "sel@steffilazerte.ca", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-7690-8360")),
77
person("Sam", "Albers", email = "sam.albers@gmail.com", role = c("aut"), comment = c(ORCID = "0000-0002-9270-7884")),

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# weathercan 1.0.1
2+
3+
- Add request url to error message for easier debugging (#216)
4+
15
# weathercan 1.0.0
26

37
- Fix ECCC change to normals download query parameters again (#207)

R/api.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ get_check <- function(url, query = NULL) {
6969
wc_stop(
7070
"API could not fetch data with this query\n",
7171
"Please, open an issue on https://github.com/ropensci/weathercan/issues and share ",
72-
"the details of your attempted download."
72+
"the details of your attempted download: ",
73+
req$request$url
7374
)
7475
}
7576
req

tests/testthat/test_04_weather_raw.R

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@ test_that("weather_html/raw (hour) download a data frame", {
1313

1414
expect_silent(wd <- weather_raw(wd))
1515

16-
# expect_error(
17-
# weather_html(station_id = 9999999999,
18-
# date = as.Date("2014-01-01"),
19-
# interval = "hour"),
20-
# "API could not fetch data with this query")
16+
expect_error(
17+
weather_html(
18+
station_id = 9999999999,
19+
date = as.Date("2014-01-01"),
20+
interval = "hour"
21+
),
22+
"API could not fetch data with this query"
23+
)
2124

2225
## Basics
2326
expect_s3_class(wd, "data.frame")

0 commit comments

Comments
 (0)