Internal helper that standardizes the message every NBA / ESPN / NCAA
wrapper emits inside its tryCatch(error = ...) block. Always emits, in
order:
.report_api_error(e, hint = NULL, args = list())Invisibly NULL. Called for its side effects.
error condition (the e from function(e) in tryCatch).
character. A friendly message with optional {name} tokens
that resolve against the caller's environment (so {game_id} etc.
pull from the wrapper's formals). If NULL, defaults to "Request
failed".
optional named list of caller arguments to dump (typically
mget(setdiff(names(formals()), "...")) captured at function entry).
A timestamped friendly hint (brace-interpolated against the caller env),
A dump of the function call's arguments,
The actual error message (conditionMessage(e)).
Functions opt in by capturing their formals once near the top --
.args <- mget(setdiff(names(formals()), "...")) -- and then calling
.report_api_error(e, hint = "...", args = .args) from the error handler.