dot-report_api_error: Report an API-call error with full context

.report_api_errorR Documentation

Report an API-call error with full context

Description

Standardizes the message every ESPN MLB wrapper emits inside its tryCatch(error = ...) block: a timestamped friendly hint (brace-interpolated against the caller env), a dump of the call's arguments, and the actual error message. Wrappers capture their formals once near the top with .args <- mget(setdiff(names(formals()), "...")) (or .args <- .capture_args() for arg-less wrappers).

Usage

.report_api_error(e, hint = NULL, args = list())

Arguments

e

error condition.

hint

character. Friendly message with optional {name} tokens that resolve against the caller's environment. Defaults to "Request failed".

args

optional named list of caller arguments to dump.

Value

Invisibly NULL. Called for its side effects.


baseballr documentation built on Aug. 27, 2026, 1:07 a.m.