Learn R Programming

nhlapi (version 0.1.4)

util_report_get_data_errors: Report errors encountered during nhl_get_data

Description

Report errors encountered during nhl_get_data

Usage

util_report_get_data_errors(x, reporter = log_e, ...)

Arguments

x

list, results created by nhl_get_data().

reporter

function, used to report the constructed error message, e.g. message, warning, writeLines, etc.

...

further arguments passed to reporter, e.g. con = file("~/log.txt") in case writeLines is the reporter.

Value

character(), URLs for which the retrieval resulted in an error, invisibly. Optional side-effects.

Examples

Run this code
# NOT RUN {
  # Write errors to a temporary text file
  tmpFile <- tempfile()
  util_report_get_data_errors(
    nhl_get_data(nhl_url_players(c("none", "8451101", "some"))),
    reporter = writeLines,
    con = tmpFile
  )
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab