util_report_get_data_errors: Report errors encountered during 'nhl_get_data'

Description Usage Arguments Value Examples

View source: R/nhl_utils.R

Description

Report errors encountered during nhl_get_data

Usage

1

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## 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
  )

## End(Not run)

nhlapi documentation built on Feb. 20, 2021, 9:06 a.m.