From 8c67f7017a2a1bf6afb1b886771291a3581fee88 Mon Sep 17 00:00:00 2001 From: saiemgilani Date: Sun, 21 Jul 2024 15:35:00 -0400 Subject: [PATCH] fix: changing all error messages and warnings to use `cli_alert_*()` functions --- R/espn_wbb_data.R | 113 ++++++++++++++++--------------------- R/espn_wnba_data.R | 88 +++++++++++++---------------- R/ncaa_wbb_data.R | 12 ++-- R/wnba_data_pbp.R | 6 +- R/wnba_stats_boxscore.R | 54 +++++++++--------- R/wnba_stats_boxscore_v3.R | 54 +++++++++--------- R/wnba_stats_cume.R | 24 ++++---- R/wnba_stats_draft.R | 44 +++++++-------- R/wnba_stats_franchise.R | 26 ++++----- R/wnba_stats_hustle.R | 26 ++++----- R/wnba_stats_leaders.R | 50 ++++++++-------- R/wnba_stats_league.R | 20 +++---- R/wnba_stats_league_dash.R | 42 +++++++------- R/wnba_stats_lineups.R | 30 +++++----- R/wnba_stats_pbp.R | 18 +++--- R/wnba_stats_player.R | 102 ++++++++++++++++----------------- R/wnba_stats_player_dash.R | 48 ++++++++-------- R/wnba_stats_roster.R | 24 ++++---- R/wnba_stats_scoreboard.R | 30 +++++----- R/wnba_stats_shotchart.R | 18 +++--- R/wnba_stats_team.R | 78 ++++++++++++------------- R/wnba_stats_team_dash.R | 54 +++++++++--------- R/wnba_stats_video.R | 24 ++++---- 23 files changed, 482 insertions(+), 503 deletions(-) diff --git a/R/espn_wbb_data.R b/R/espn_wbb_data.R index beb6a9b..82b8afa 100644 --- a/R/espn_wbb_data.R +++ b/R/espn_wbb_data.R @@ -220,20 +220,19 @@ espn_wbb_game_all <- function(game_id){ plays_df <- helper_espn_wbb_pbp(resp) if (is.null(plays_df)) { - message(glue::glue("{Sys.time()}: No play-by-play data for {game_id} available!")) + cli::cli_alert_danger("{Sys.time()}: No play-by-play data for {game_id} available!") } }, error = function(e) { - message( - glue::glue( + cli::cli_alert_danger( "{Sys.time()}: Invalid arguments or no play-by-play data for {game_id} available!" - ) ) - message(glue::glue("Error:\n{e}")) + + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { @@ -246,20 +245,18 @@ espn_wbb_game_all <- function(game_id){ team_box_score <- helper_espn_wbb_team_box(resp) if (is.null(team_box_score)) { - message(glue::glue("{Sys.time()}: No team box score data for {game_id} available!")) + cli::cli_alert_danger("{Sys.time()}: No team box score data for {game_id} available!") } }, error = function(e) { - message( - glue::glue( + cli::cli_alert_danger( "{Sys.time()}: Invalid arguments or no team box score data for {game_id} available!" - ) ) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { @@ -272,20 +269,18 @@ espn_wbb_game_all <- function(game_id){ player_box_score <- helper_espn_wbb_player_box(resp) if (is.null(player_box_score)) { - message(glue::glue("{Sys.time()}: No player box score data for {game_id} available!")) + cli::cli_alert_danger("{Sys.time()}: No player box score data for {game_id} available!") } }, error = function(e) { - message( - glue::glue( + cli::cli_alert_danger( "{Sys.time()}: Invalid arguments or no player box score data for {game_id} available!" - ) ) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { @@ -397,20 +392,18 @@ espn_wbb_pbp <- function(game_id){ plays_df <- helper_espn_wbb_pbp(resp) if (is.null(plays_df)) { - return(message(glue::glue("{Sys.time()}: No play-by-play data for {game_id} available!"))) + return(cli::cli_alert_danger("{Sys.time()}: No play-by-play data for {game_id} available!")) } }, error = function(e) { - message( - glue::glue( + cli::cli_alert_danger( "{Sys.time()}: Invalid arguments or no play-by-play data for {game_id} available!" - ) ) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { @@ -520,20 +513,18 @@ espn_wbb_team_box <- function(game_id){ team_box_score <- helper_espn_wbb_team_box(resp) if (is.null(team_box_score)) { - return(message(glue::glue("{Sys.time()}: No team box score data for {game_id} available!"))) + cli::cli_alert_danger("{Sys.time()}: No team box score data for {game_id} available!") } }, error = function(e) { - message( - glue::glue( + cli::cli_alert_danger( "{Sys.time()}: Invalid arguments or no team box score data for {game_id} available!" - ) ) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { @@ -644,20 +635,18 @@ espn_wbb_player_box <- function(game_id){ player_box_score <- helper_espn_wbb_player_box(resp) if (is.null(player_box_score)) { - return(message(glue::glue("{Sys.time()}: No player box score data for {game_id} available!"))) + return(cli::cli_alert_danger("{Sys.time()}: No player box score data for {game_id} available!")) } }, error = function(e) { - message( - glue::glue( + cli::cli_alert_danger( "{Sys.time()}: Invalid arguments or no player box score data for {game_id} available!" - ) ) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { @@ -963,15 +952,13 @@ espn_wbb_game_rosters <- function(game_id) { }, error = function(e) { - message( - glue::glue( + cli::cli_alert_danger( "{Sys.time()}: Invalid arguments or no game roster data for {game_id} available!" - ) ) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { @@ -1040,11 +1027,11 @@ espn_wbb_conferences <- function(){ make_wehoop_data("ESPN WBB Conferences Information from ESPN.com",Sys.time()) }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no conferences info available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no conferences info available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -1222,11 +1209,11 @@ espn_wbb_teams <- function(year = most_recent_wbb_season()){ }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no teams data available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no teams data available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -1445,10 +1432,10 @@ parse_espn_wbb_scoreboard <- function(group, season_dates) { }, error = function(e) { - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { @@ -1537,9 +1524,9 @@ espn_wbb_scoreboard <- function(season) { parse_espn_wbb_scoreboard) if (!nrow(scoreboard_df)) { - message(glue::glue( + cli::cli_alert_danger( "{Sys.time()}: Invalid arguments or no scoreboard data available!" - )) + ) } return(scoreboard_df) } @@ -1657,11 +1644,11 @@ espn_wbb_rankings <- function(){ make_wehoop_data("ESPN WBB Rankings Information from ESPN.com",Sys.time()) }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no rankings data for {game_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no rankings data for {game_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -1899,11 +1886,11 @@ espn_wbb_standings <- function(year){ make_wehoop_data("ESPN WBB Standings Information from ESPN.com",Sys.time()) }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no standings data available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no standings data available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -2149,11 +2136,11 @@ espn_wbb_team_stats <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}:Invalid arguments or no team season stats data available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}:Invalid arguments or no team season stats data available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -2462,11 +2449,11 @@ espn_wbb_player_stats <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}:Invalid arguments or no player season stats data available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}:Invalid arguments or no player season stats data available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } diff --git a/R/espn_wnba_data.R b/R/espn_wnba_data.R index 0479a82..63a3af0 100644 --- a/R/espn_wnba_data.R +++ b/R/espn_wnba_data.R @@ -223,20 +223,18 @@ espn_wnba_game_all <- function(game_id){ plays_df <- helper_espn_wnba_pbp(resp) if (is.null(plays_df)) { - message(glue::glue("{Sys.time()}: No play-by-play data for {game_id} available!")) + cli::cli_alert_danger("{Sys.time()}: No play-by-play data for {game_id} available!") } }, error = function(e) { - message( - glue::glue( + cli::cli_alert_danger( "{Sys.time()}: Invalid arguments or no play-by-play data for {game_id} available!" - ) ) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { @@ -249,20 +247,18 @@ espn_wnba_game_all <- function(game_id){ team_box_score <- helper_espn_wnba_team_box(resp) if (is.null(team_box_score)) { - message(glue::glue("{Sys.time()}: No team box score data for {game_id} available!")) + cli::cli_alert_danger("{Sys.time()}: No team box score data for {game_id} available!") } }, error = function(e) { - message( - glue::glue( + cli::cli_alert_danger( "{Sys.time()}: Invalid arguments or no team box score data for {game_id} available!" - ) ) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { @@ -275,20 +271,18 @@ espn_wnba_game_all <- function(game_id){ player_box_score <- helper_espn_wnba_player_box(resp) if (is.null(player_box_score)) { - message(glue::glue("{Sys.time()}: No player box score data for {game_id} available!")) + cli::cli_alert_danger("{Sys.time()}: No player box score data for {game_id} available!") } }, error = function(e) { - message( - glue::glue( + cli::cli_alert_danger( "{Sys.time()}: Invalid arguments or no player box score data for {game_id} available!" - ) ) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { @@ -403,16 +397,16 @@ espn_wnba_pbp <- function(game_id){ plays_df <- helper_espn_wnba_pbp(resp) if (is.null(plays_df)) { - return(message(glue::glue("{Sys.time()}: No play-by-play data for {game_id} available!"))) + return(cli::cli_alert_danger("{Sys.time()}: No play-by-play data for {game_id} available!")) } }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no play-by-play data for {game_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no play-by-play data for {game_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -525,16 +519,16 @@ espn_wnba_team_box <- function(game_id){ team_box_score <- helper_espn_wnba_team_box(resp) if (is.null(team_box_score)) { - return(message(glue::glue("{Sys.time()}: No team box score data for {game_id} available!"))) + return(cli::cli_alert_danger("{Sys.time()}: No team box score data for {game_id} available!")) } }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no team box score data for {game_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no team box score data for {game_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -648,16 +642,16 @@ espn_wnba_player_box <- function(game_id){ player_box_score <- helper_espn_wnba_player_box(resp) if (is.null(player_box_score)) { - return(message(glue::glue("{Sys.time()}: No player box score data for {game_id} available!"))) + return(cli::cli_alert_danger("{Sys.time()}: No player box score data for {game_id} available!")) } }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no player box score data for {game_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no player box score data for {game_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -981,15 +975,13 @@ espn_wnba_game_rosters <- function(game_id) { }, error = function(e) { - message( - glue::glue( + cli::cli_alert_danger( "{Sys.time()}: Invalid arguments or no game roster data for {game_id} available!" - ) ) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { @@ -1144,7 +1136,7 @@ espn_wnba_teams <- function(){ espn_wnba_scoreboard <- function(season){ - # message(glue::glue("Returning data for {season}!")) + # cli::cli_alert_danger("Returning data for {season}!")) max_year <- substr(Sys.Date(), 1,4) @@ -1299,11 +1291,11 @@ espn_wnba_scoreboard <- function(season){ } }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no scoreboard data available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no scoreboard data available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -1428,11 +1420,11 @@ espn_wnba_standings <- function(year){ make_wehoop_data("ESPN WNBA Standings Information from ESPN.com",Sys.time()) }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no standings data available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no standings data available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -1704,11 +1696,11 @@ espn_wnba_team_stats <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}:Invalid arguments or no team season stats data available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}:Invalid arguments or no team season stats data available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -2034,11 +2026,11 @@ espn_wnba_player_stats <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}:Invalid arguments or no player season stats data available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}:Invalid arguments or no player season stats data available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } diff --git a/R/ncaa_wbb_data.R b/R/ncaa_wbb_data.R index df75b21..338ec13 100644 --- a/R/ncaa_wbb_data.R +++ b/R/ncaa_wbb_data.R @@ -42,11 +42,11 @@ ncaa_wbb_NET_rankings <- function(){ make_wehoop_data("NCAA WBB NET Rankings Information from NCAA.com",Sys.time()) }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no NET rankings available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no NET rankings available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -196,11 +196,11 @@ ncaa_wbb_teams <- function(year = most_recent_wbb_season(), division = 1, ...) { }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments provided")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments provided") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } diff --git a/R/wnba_data_pbp.R b/R/wnba_data_pbp.R index 9369c56..f981be7 100644 --- a/R/wnba_data_pbp.R +++ b/R/wnba_data_pbp.R @@ -144,11 +144,11 @@ wnba_data_pbp <- function(game_id = "1022200034", make_wehoop_data("WNBA Play-by-Play Information from data.WNBA.com",Sys.time()) }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no play-by-play data for {game_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no play-by-play data for {game_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } diff --git a/R/wnba_stats_boxscore.R b/R/wnba_stats_boxscore.R index 6f51f26..f969b13 100644 --- a/R/wnba_stats_boxscore.R +++ b/R/wnba_stats_boxscore.R @@ -151,11 +151,11 @@ wnba_boxscoretraditionalv2 <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no traditional boxscore v2 data for {game_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no traditional boxscore v2 data for {game_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -292,11 +292,11 @@ wnba_boxscoreadvancedv2 <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no advanced boxscore v2 data for {game_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no advanced boxscore v2 data for {game_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -405,11 +405,11 @@ wnba_boxscorefourfactorsv2 <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no four factors boxscore v2 data for {game_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no four factors boxscore v2 data for {game_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -525,11 +525,11 @@ wnba_boxscoremiscv2 <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no miscellaneous boxscore v2 data for {game_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no miscellaneous boxscore v2 data for {game_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -651,11 +651,11 @@ wnba_boxscorescoringv2 <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no scoring boxscore v2 data for {game_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no scoring boxscore v2 data for {game_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -783,11 +783,11 @@ wnba_boxscoreusagev2 <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no usage boxscore v2 data for {game_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no usage boxscore v2 data for {game_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -985,11 +985,11 @@ wnba_boxscoresummaryv2 <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no summary boxscore v2 data for {game_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no summary boxscore v2 data for {game_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -1106,11 +1106,11 @@ wnba_boxscoreplayertrackv2 <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no player tracking boxscore v2 data for {game_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no player tracking boxscore v2 data for {game_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -1229,11 +1229,11 @@ wnba_hustlestatsboxscore <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no hustle stats boxscore data for {game_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no hustle stats boxscore data for {game_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } diff --git a/R/wnba_stats_boxscore_v3.R b/R/wnba_stats_boxscore_v3.R index a5bf58a..61e7592 100644 --- a/R/wnba_stats_boxscore_v3.R +++ b/R/wnba_stats_boxscore_v3.R @@ -474,11 +474,11 @@ wnba_boxscoretraditionalv3 <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no traditional boxscore v3 data for {game_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no traditional boxscore v3 data for {game_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -794,11 +794,11 @@ wnba_boxscoreadvancedv3 <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no advanced boxscore v3 data for {game_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no advanced boxscore v3 data for {game_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -1073,11 +1073,11 @@ wnba_boxscoremiscv3 <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no misc boxscore v3 data for {game_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no misc boxscore v3 data for {game_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -1364,11 +1364,11 @@ wnba_boxscorescoringv3 <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no scoring boxscore v3 data for {game_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no scoring boxscore v3 data for {game_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -1628,11 +1628,11 @@ wnba_boxscorefourfactorsv3 <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no four factors boxscore v3 data for {game_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no four factors boxscore v3 data for {game_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -1937,11 +1937,11 @@ wnba_boxscoreplayertrackv3 <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no player tracking boxscore v3 data for {game_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no player tracking boxscore v3 data for {game_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -2219,11 +2219,11 @@ wnba_boxscorehustlev2 <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no hustle stats boxscore v2 data for {game_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no hustle stats boxscore v2 data for {game_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -2327,11 +2327,11 @@ wnba_gamerotation <- function( names(df_list) <- resp$resultSets$name }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no game rotation data for {game_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no game rotation data for {game_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -2586,7 +2586,7 @@ wnba_gamerotation <- function( # # }, # error = function(e) { -# message(glue::glue("{Sys.time()}: Invalid arguments or no defensive boxscore v2 data for {game_id} available!")) +# cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no defensive boxscore v2 data for {game_id} available!") # }, # warning = function(w) { # }, @@ -2773,7 +2773,7 @@ wnba_gamerotation <- function( # home_team_data <- data %>% # purrr::pluck("homeTeam") # if (is.null(home_team_data$teamCity)) { -# return(message(glue::glue("{Sys.time()}: No matchups boxscore v3 data for {game_id} available!"))) +# return(cli::cli_alert_danger("{Sys.time()}: No matchups boxscore v3 data for {game_id} available!")) # } # home_team_info <- data.frame( # team_id = home_team_data %>% purrr::pluck("teamId"), @@ -2830,7 +2830,7 @@ wnba_gamerotation <- function( # # }, # error = function(e) { -# message(glue::glue("{Sys.time()}: Invalid arguments or no matchups boxscore v3 data for {game_id} available!")) +# cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no matchups boxscore v3 data for {game_id} available!") # }, # warning = function(w) { # }, diff --git a/R/wnba_stats_cume.R b/R/wnba_stats_cume.R index 829237d..6eb2ced 100644 --- a/R/wnba_stats_cume.R +++ b/R/wnba_stats_cume.R @@ -145,11 +145,11 @@ wnba_cumestatsplayer <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no cumulative player stats data available for {player_id}!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no cumulative player stats data available for {player_id}!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -232,11 +232,11 @@ wnba_cumestatsplayergames <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no cumulative player game stats data available for {player_id}!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no cumulative player game stats data available for {player_id}!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -395,11 +395,11 @@ wnba_cumestatsteam <- function( df_list <- wnba_stats_map_result_sets(resp) }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no cumulative team stats data available for {team_id}!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no cumulative team stats data available for {team_id}!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -484,11 +484,11 @@ wnba_cumestatsteamgames <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no cumulative team game stats data available for {team_id}!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no cumulative team game stats data available for {team_id}!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } diff --git a/R/wnba_stats_draft.R b/R/wnba_stats_draft.R index 484a994..b9a9747 100644 --- a/R/wnba_stats_draft.R +++ b/R/wnba_stats_draft.R @@ -111,11 +111,11 @@ wnba_draftboard <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no draft board data available for {season}!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no draft board data available for {season}!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -221,11 +221,11 @@ wnba_draftcombinestats <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no draft combine stats data available for {season_year}!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no draft combine stats data available for {season_year}!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -279,11 +279,11 @@ wnba_draftcombinedrillresults <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no draft combine drill results data available for {season_year}!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no draft combine drill results data available for {season_year}!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -337,11 +337,11 @@ wnba_draftcombinenonstationaryshooting <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no draft combine stationary shooting data available for {season_year}!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no draft combine stationary shooting data available for {season_year}!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -395,11 +395,11 @@ wnba_draftcombineplayeranthro <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no draft combine player anthropological data available for {season_year}!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no draft combine player anthropological data available for {season_year}!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -452,11 +452,11 @@ wnba_draftcombinespotshooting <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no draft combine spot shooting data available for {season_year}!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no draft combine spot shooting data available for {season_year}!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -544,14 +544,14 @@ wnba_drafthistory <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no draft history data available for {season}!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no draft history data available for {season}!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } ) return(df_list) -} \ No newline at end of file +} diff --git a/R/wnba_stats_franchise.R b/R/wnba_stats_franchise.R index 678ea3f..1279cea 100644 --- a/R/wnba_stats_franchise.R +++ b/R/wnba_stats_franchise.R @@ -65,11 +65,11 @@ wnba_franchiseleaders <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no franchise leaders data available for {team_id}!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no franchise leaders data available for {team_id}!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -182,11 +182,11 @@ wnba_franchiseleaderswrank <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no franchise players data available for {team_id}!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no franchise players data available for {team_id}!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -281,11 +281,11 @@ wnba_franchiseplayers <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no franchise players data available for {team_id}!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no franchise players data available for {team_id}!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -378,14 +378,14 @@ wnba_franchisehistory <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no franchise history data available for {team_id}!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no franchise history data available for {team_id}!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } ) return(df_list) -} \ No newline at end of file +} diff --git a/R/wnba_stats_hustle.R b/R/wnba_stats_hustle.R index c915b04..19c4a49 100644 --- a/R/wnba_stats_hustle.R +++ b/R/wnba_stats_hustle.R @@ -150,11 +150,11 @@ wnba_leaguehustlestatsplayer <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no league hustle player stats data available for {season}!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no league hustle player stats data available for {season}!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -359,11 +359,11 @@ wnba_leaguehustlestatsplayerleaders <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no league hustle stats player leaders data available for {season}!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no league hustle stats player leaders data available for {season}!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -514,11 +514,11 @@ wnba_leaguehustlestatsteam <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no league hustle team stats data available for {season}!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no league hustle team stats data available for {season}!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -721,14 +721,14 @@ wnba_leaguehustlestatsteamleaders <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no league hustle team stats leaders data available for {season}!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no league hustle team stats leaders data available for {season}!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } ) return(df_list) -} \ No newline at end of file +} diff --git a/R/wnba_stats_leaders.R b/R/wnba_stats_leaders.R index 27cbfa0..c0cae4f 100644 --- a/R/wnba_stats_leaders.R +++ b/R/wnba_stats_leaders.R @@ -263,11 +263,11 @@ wnba_alltimeleadersgrids <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no all-time leaders grid data for {league_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no all-time leaders grid data for {league_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -347,11 +347,11 @@ wnba_assistleaders <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no assist leaders data for {season} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no assist leaders data for {season} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -415,11 +415,11 @@ wnba_assisttracker <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no assist tracker data for {season} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no assist tracker data for {season} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -538,11 +538,11 @@ wnba_homepageleaders <- function( # # }, # error = function(e) { - # message(glue::glue("{Sys.time()}: Invalid arguments or no homepage leaders data for {season} available!")) - # message(glue::glue("Error:\n{e}")) + # cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no homepage leaders data for {season} available!") + # cli::cli_alert_danger("Error:\n{e}") # }, # warning = function(w) { - # message(glue::glue("{Sys.time()}: Warning:\n{w}")) + # cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") # }, # finally = { # } @@ -705,11 +705,11 @@ wnba_homepagev2 <- function( # # }, # error = function(e) { - # message(glue::glue("{Sys.time()}: Invalid arguments or no homepage v2 data for {season} available!\n{e}")) - # message(glue::glue("Error:\n{e}")) + # cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no homepage v2 data for {season} available!") + # cli::cli_alert_danger("Error:\n{e}") # }, # warning = function(w) { - # message(glue::glue("{Sys.time()}: Warning:\n{w}")) + # cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") # }, # finally = { # } @@ -1340,11 +1340,11 @@ wnba_homepagewidget <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no homepage widget data for {season} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no homepage widget data for {season} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -1464,11 +1464,11 @@ wnba_leaderstiles <- function( # # }, # error = function(e) { - # message(glue::glue("{Sys.time()}: Invalid arguments or no leaders tiles data for {season} available!")) - # message(glue::glue("Error:\n{e}")) + # cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no leaders tiles data for {season} available!") + # cli::cli_alert_danger("Error:\n{e}") # }, # warning = function(w) { - # message(glue::glue("{Sys.time()}: Warning:\n{w}")) + # cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") # }, # finally = { # } @@ -1582,11 +1582,11 @@ wnba_leagueleaders <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no league leaders data for {season} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no league leaders data for {season} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -1656,7 +1656,7 @@ wnba_leagueleaders <- function( # # }, # error = function(e) { -# message(glue::glue("{Sys.time()}: Invalid arguments or no defense hub data for {season} available!")) +# cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no defense hub data for {season} available!") # }, # warning = function(w) { # }, diff --git a/R/wnba_stats_league.R b/R/wnba_stats_league.R index 4c809de..ed42196 100644 --- a/R/wnba_stats_league.R +++ b/R/wnba_stats_league.R @@ -101,11 +101,11 @@ wnba_leaguegamelog <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no league game log data for {season} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no league game log data for {season} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -262,11 +262,11 @@ wnba_leaguestandingsv3 <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no league standings v3 data available for {season}!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no league standings v3 data available for {season}!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -613,11 +613,11 @@ wnba_leaguegamefinder <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no league game finder data available for the given parameters!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no league game finder data available for the given parameters!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -794,7 +794,7 @@ wnba_leaguegamefinder <- function( # # }, # error = function(e) { -# message(glue::glue("{Sys.time()}: Invalid arguments or no playoff picture data available for {season}!")) +# cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no playoff picture data available for {season}!") # }, # warning = function(w) { # }, diff --git a/R/wnba_stats_league_dash.R b/R/wnba_stats_league_dash.R index 9bd58eb..267ea90 100644 --- a/R/wnba_stats_league_dash.R +++ b/R/wnba_stats_league_dash.R @@ -166,11 +166,11 @@ wnba_leaguedashplayerbiostats <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no league dashboard player bio stats data for {season} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no league dashboard player bio stats data for {season} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -411,11 +411,11 @@ wnba_leaguedashplayerclutch <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no league dashboard player clutch stats data for {season} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no league dashboard player clutch stats data for {season} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -645,11 +645,11 @@ wnba_leaguedashplayerstats <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no league dashboard player stats data for {season} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no league dashboard player stats data for {season} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -860,11 +860,11 @@ wnba_leaguedashplayershotlocations <- function( names(df_list) <- resp$resultSets$name }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no league dashboard player shot locations data for {season} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no league dashboard player shot locations data for {season} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -1073,11 +1073,11 @@ wnba_leaguedashteamclutch <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no league dashboard team clutch data for {season} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no league dashboard team clutch data for {season} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -1271,11 +1271,11 @@ wnba_leaguedashteamstats <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no league dashboard team stats data for {season} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no league dashboard team stats data for {season} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -1460,11 +1460,11 @@ wnba_leaguedashteamshotlocations <- function( names(df_list) <- resp$resultSets$name }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no league dashboard team shot location data for {season} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no league dashboard team shot location data for {season} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } diff --git a/R/wnba_stats_lineups.R b/R/wnba_stats_lineups.R index 8b723bb..7c3b660 100644 --- a/R/wnba_stats_lineups.R +++ b/R/wnba_stats_lineups.R @@ -121,11 +121,11 @@ wnba_fantasywidget <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no fantasy widget data for {season} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no fantasy widget data for {season} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -315,11 +315,11 @@ wnba_leaguedashlineups <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no league dashboard lineups data for {season} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no league dashboard lineups data for {season} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -479,11 +479,11 @@ wnba_leaguelineupviz <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no league lineup viz data for {season} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no league lineup viz data for {season} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -662,11 +662,11 @@ wnba_leagueplayerondetails <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no league player on/off details data for {season} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no league player on/off details data for {season} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -776,11 +776,11 @@ wnba_leagueseasonmatchups <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no league season matchups data for {season} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no league season matchups data for {season} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } diff --git a/R/wnba_stats_pbp.R b/R/wnba_stats_pbp.R index 0aed6b7..6de238d 100644 --- a/R/wnba_stats_pbp.R +++ b/R/wnba_stats_pbp.R @@ -365,11 +365,11 @@ wnba_pbp <- function(game_id, } }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no play-by-play data for {pad_id(game_id)} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no play-by-play data for {pad_id(game_id)} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -634,11 +634,11 @@ wnba_live_pbp <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no play-by-play data for {game_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no play-by-play data for {game_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -1183,11 +1183,11 @@ wnba_live_boxscore <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no boxscore data for {game_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no boxscore data for {game_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } diff --git a/R/wnba_stats_player.R b/R/wnba_stats_player.R index 8e81e28..4fe0c77 100644 --- a/R/wnba_stats_player.R +++ b/R/wnba_stats_player.R @@ -107,11 +107,11 @@ wnba_playerindex <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no player index data for {season} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no player index data for {season} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -152,11 +152,11 @@ wnba_playerheadshot <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no player headshot for {player_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no player headshot for {player_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -226,11 +226,11 @@ wnba_playerawards <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no player awards data for {player_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no player awards data for {player_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -323,11 +323,11 @@ wnba_playercareerbycollege <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or player careers by college data for {player_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or player careers by college data for {player_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -508,11 +508,11 @@ wnba_playercareerbycollegerollup <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or player careers by college rollup data for {season} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or player careers by college rollup data for {season} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -835,11 +835,11 @@ wnba_playercareerstats <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or player career stats data for {player_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or player career stats data for {player_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -928,11 +928,11 @@ wnba_infographicfanduelplayer <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no FanDuel player infographic data for {game_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no FanDuel player infographic data for {game_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -1199,11 +1199,11 @@ wnba_playerfantasyprofile <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no player fantasy profile data for {player_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no player fantasy profile data for {player_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -1308,11 +1308,11 @@ wnba_playerfantasyprofilebargraph <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no player fantasy profile bar graph data for {player_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no player fantasy profile bar graph data for {player_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -1418,11 +1418,11 @@ wnba_playerestimatedmetrics <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no player estimated metrics data for {player_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no player estimated metrics data for {player_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -1522,11 +1522,11 @@ wnba_playergamelog <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no player game log data for {player_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no player game log data for {player_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -1709,11 +1709,11 @@ wnba_playergamelogs <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no player game logs data for {player_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no player game logs data for {player_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -2046,11 +2046,11 @@ wnba_playergamestreakfinder <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no player streak finder data available for the parameters selected!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no player streak finder data available for the parameters selected!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -2133,11 +2133,11 @@ wnba_playernextngames <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no player next n games data available for {player_id}!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no player next n games data available for {player_id}!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -2571,11 +2571,11 @@ wnba_playerprofilev2 <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no player profile v2 data available for {player_id}!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no player profile v2 data available for {player_id}!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -2890,11 +2890,11 @@ wnba_playervsplayer <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or player vs player data unavailable for the parameters selected!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or player vs player data unavailable for the parameters selected!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -3075,11 +3075,11 @@ wnba_playercompare <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or player comparison data unavailable for the parameters selected!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or player comparison data unavailable for the parameters selected!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } diff --git a/R/wnba_stats_player_dash.R b/R/wnba_stats_player_dash.R index 86f2ba2..f572280 100644 --- a/R/wnba_stats_player_dash.R +++ b/R/wnba_stats_player_dash.R @@ -863,11 +863,11 @@ wnba_playerdashboardbyclutch <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or player dashboard by clutch splits data available for {player_id}!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or player dashboard by clutch splits data available for {player_id}!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -1327,11 +1327,11 @@ wnba_playerdashboardbygamesplits <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or player dashboard by game splits data available for {player_id}!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or player dashboard by game splits data available for {player_id}!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -1928,11 +1928,11 @@ wnba_playerdashboardbygeneralsplits <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no player dashboard by general splits data available for {player_id}!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no player dashboard by general splits data available for {player_id}!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -2461,11 +2461,11 @@ wnba_playerdashboardbylastngames <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no player dashboard by last n games data available for {player_id}!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no player dashboard by last n games data available for {player_id}!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -2857,11 +2857,11 @@ wnba_playerdashboardbyopponent <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no player dashboard by opponent data available for {player_id}!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no player dashboard by opponent data available for {player_id}!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -3257,11 +3257,11 @@ wnba_playerdashboardbyshootingsplits <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no player dashboard by shooting splits data available for {player_id}!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no player dashboard by shooting splits data available for {player_id}!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -3659,11 +3659,11 @@ wnba_playerdashboardbyteamperformance <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no player dashboard by team performance data available for {player_id}!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no player dashboard by team performance data available for {player_id}!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -3923,11 +3923,11 @@ wnba_playerdashboardbyyearoveryear <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no player dashboard year-over-year data available for {player_id}!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no player dashboard year-over-year data available for {player_id}!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } diff --git a/R/wnba_stats_roster.R b/R/wnba_stats_roster.R index 6775b6d..5781734 100644 --- a/R/wnba_stats_roster.R +++ b/R/wnba_stats_roster.R @@ -68,11 +68,11 @@ wnba_commonallplayers <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or common all players data for {season} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or common all players data for {season} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -185,11 +185,11 @@ wnba_commonplayerinfo <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or common player info data for {season} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or common player info data for {season} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -254,11 +254,11 @@ wnba_commonplayoffseries <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or common playoff series data for {season} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or common playoff series data for {season} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -351,11 +351,11 @@ wnba_commonteamroster <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or common team roster data for {season} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or common team roster data for {season} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } diff --git a/R/wnba_stats_scoreboard.R b/R/wnba_stats_scoreboard.R index 5d0def0..60d0d92 100644 --- a/R/wnba_stats_scoreboard.R +++ b/R/wnba_stats_scoreboard.R @@ -121,11 +121,11 @@ wnba_schedule <- function( ) }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no league schedule data for {season} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no league schedule data for {season} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -314,11 +314,11 @@ wnba_scoreboard <- function( # # }, # error = function(e) { - # message(glue::glue("{Sys.time()}: Invalid arguments or no scoreboard data for {game_date} available!")) - # message(glue::glue("Error:\n{e}")) + # cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no scoreboard data for {game_date} available!") + # cli::cli_alert_danger("Error:\n{e}") # }, # warning = function(w) { - # message(glue::glue("{Sys.time()}: Warning:\n{w}")) + # cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") # }, # finally = { # } @@ -534,11 +534,11 @@ wnba_scoreboardv2 <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no scoreboardv2 data for {game_date} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no scoreboardv2 data for {game_date} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -717,11 +717,11 @@ wnba_scoreboardv3 <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no scoreboard v3 data for {game_date} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no scoreboard v3 data for {game_date} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -841,11 +841,11 @@ wnba_todays_scoreboard <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no today's scoreboard data for {game_date} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no today's scoreboard data for {game_date} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } diff --git a/R/wnba_stats_shotchart.R b/R/wnba_stats_shotchart.R index 63481aa..b9cff22 100644 --- a/R/wnba_stats_shotchart.R +++ b/R/wnba_stats_shotchart.R @@ -144,11 +144,11 @@ wnba_shotchartdetail <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no shot chart detail data for {player_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no shot chart detail data for {player_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -215,11 +215,11 @@ wnba_shotchartleaguewide <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no league-wide shot chart data for {season} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no league-wide shot chart data for {season} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -479,11 +479,11 @@ wnba_shotchartlineupdetail <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no shot chart lineup data available for {season}! (group_id: {group_id})")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no shot chart lineup data available for {season}! (group_id: {group_id})") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } diff --git a/R/wnba_stats_team.R b/R/wnba_stats_team.R index 5bc4ffe..e6f0f96 100644 --- a/R/wnba_stats_team.R +++ b/R/wnba_stats_team.R @@ -90,11 +90,11 @@ wnba_teams <- function(...){ }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no team details data for {team_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no team details data for {team_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -230,11 +230,11 @@ wnba_teamdetails <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no team details data for {team_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no team details data for {team_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -337,11 +337,11 @@ wnba_teamestimatedmetrics <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no team estimated metrics data for {season} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no team estimated metrics data for {season} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -443,11 +443,11 @@ wnba_teamgamelog <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no team game log data for {team_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no team game log data for {team_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -619,11 +619,11 @@ wnba_teamgamelogs <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no team game logs for {team_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no team game logs for {team_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -703,11 +703,11 @@ wnba_teamhistoricalleaders <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no team historical leaders data for {team_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no team historical leaders data for {team_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -816,11 +816,11 @@ wnba_teaminfocommon <- function( # # }, # error = function(e) { - # message(glue::glue("{Sys.time()}: Invalid arguments or no team common info data for {team_id} available!")) - # message(glue::glue("Error:\n{e}")) + # cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no team common info data for {team_id} available!") + # cli::cli_alert_danger("Error:\n{e}") # }, # warning = function(w) { - # message(glue::glue("{Sys.time()}: Warning:\n{w}")) + # cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") # }, # finally = { # } @@ -1132,11 +1132,11 @@ wnba_teamplayeronoffdetails <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no team player on off details data for {team_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no team player on off details data for {team_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -1356,11 +1356,11 @@ wnba_teamplayeronoffsummary <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no team player on off summary data for {team_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no team player on off summary data for {team_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -1611,11 +1611,11 @@ wnba_teamplayerdashboard <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no team player dashboard data for {team_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no team player dashboard data for {team_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -1717,11 +1717,11 @@ wnba_teamyearbyyearstats <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no team year-by-year stats data for {team_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no team year-by-year stats data for {team_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -2140,11 +2140,11 @@ wnba_teamvsplayer <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no team vs player data for {team_id} and {player_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no team vs player data for {team_id} and {player_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -2778,11 +2778,11 @@ wnba_teamgamestreakfinder <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no team streak finder data for the given parameters available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no team streak finder data for the given parameters available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } diff --git a/R/wnba_stats_team_dash.R b/R/wnba_stats_team_dash.R index 8c14149..2e5cc22 100644 --- a/R/wnba_stats_team_dash.R +++ b/R/wnba_stats_team_dash.R @@ -774,11 +774,11 @@ wnba_teamdashboardbyclutch <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no team dashboard by clutch data for {team_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no team dashboard by clutch data for {team_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -1198,11 +1198,11 @@ wnba_teamdashboardbygamesplits <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no team dashboard by game splits data for {team_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no team dashboard by game splits data for {team_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -1689,11 +1689,11 @@ wnba_teamdashboardbygeneralsplits <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no team dashboard by general splits data for {team_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no team dashboard by general splits data for {team_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -2174,11 +2174,11 @@ wnba_teamdashboardbylastngames <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no teamdashboard by last n games data for {team_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no teamdashboard by last n games data for {team_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -2538,11 +2538,11 @@ wnba_teamdashboardbyopponent <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no team dashboard by opponent data for {team_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no team dashboard by opponent data for {team_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -2917,11 +2917,11 @@ wnba_teamdashboardbyshootingsplits <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no team dashboard by shooting splits data for {team_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no team dashboard by shooting splits data for {team_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -3286,11 +3286,11 @@ wnba_teamdashboardbyteamperformance <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no team dashboard by team performance data for {team_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no team dashboard by team performance data for {team_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -3528,11 +3528,11 @@ wnba_teamdashboardbyyearoveryear <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no team dashboard by year-over-year data for {team_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no team dashboard by year-over-year data for {team_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -3781,11 +3781,11 @@ wnba_teamdashlineups <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no team dashboard by lineups data for {team_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no team dashboard by lineups data for {team_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } diff --git a/R/wnba_stats_video.R b/R/wnba_stats_video.R index ce9b69b..5f03076 100644 --- a/R/wnba_stats_video.R +++ b/R/wnba_stats_video.R @@ -175,11 +175,11 @@ wnba_videodetailsasset <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no video detail assets data available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no video detail assets data available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -363,11 +363,11 @@ wnba_videodetails <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no video details data available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no video details data available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -427,11 +427,11 @@ wnba_videoevents <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no video events data for {game_id} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no video events data for {game_id} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { } @@ -504,11 +504,11 @@ wnba_videostatus <- function( }, error = function(e) { - message(glue::glue("{Sys.time()}: Invalid arguments or no video status data for {game_date} available!")) - message(glue::glue("Error:\n{e}")) + cli::cli_alert_danger("{Sys.time()}: Invalid arguments or no video status data for {game_date} available!") + cli::cli_alert_danger("Error:\n{e}") }, warning = function(w) { - message(glue::glue("{Sys.time()}: Warning:\n{w}")) + cli::cli_alert_warning("{Sys.time()}: Warning:\n{w}") }, finally = { }