courtsbr / esaj

Scrapers for many e-SAJ systems
http://courtsbr.github.io/esaj/
GNU General Public License v2.0
46 stars 20 forks source link

peek_cjsg() returns error when there are 0 results #23

Closed jtrecenti closed 6 years ago

jtrecenti commented 6 years ago

Example

n_pags <- esaj::peek_cjsg(query = "", subjects = "14")  
#> There are 169 pages to download
#> This should take around 1.4 minutes
n_pags                                                  
#> [1] 167

n_pags <- esaj::peek_cjsg(query = "", subjects = "5944")
#> Error in ceiling(.): non-numeric argument to mathematical function

I think it should throw a message and return 0L

Also the result is always numeric. it should be an integer.

clente commented 6 years ago

[2e14098df402a816ff4c4b7b2749aa6982791d1e] esaj::peek_cjsg() now reports that there are no pages to download.