nflverse / nflverse-data

Automated nflverse data repository
https://www.nflverse.com
Creative Commons Attribution 4.0 International
196 stars 18 forks source link

Catch warnings and error on warnings #48

Closed mrcaseb closed 3 months ago

mrcaseb commented 3 months ago

The system call errors on stuff like missing gh cli but not if something inside the gh cli goes wrong, e.g. lost internet connection or incorrect tag name. In these cases, system just throws a warning message and our workflows don't fail.

It's better to throw an error in these cases because we want to be altered with failing workflows. That's why I catch warnings with purrr::quietly and error if a warning has been thrown. The message returns both the R warning and the gh cli message.

mrcaseb commented 3 months ago

Based on https://github.com/nflverse/nflverse-data/issues/47#issuecomment-2305996503