Skip to content

v1.7.2

Choose a tag to compare

@Tomeriko96 Tomeriko96 released this 06 Jun 11:21
· 15 commits to main since this release

CRAN compliance: graceful network failure handling

All functions that use internet resources now fail gracefully with an informative message when the service is unavailable, per CRAN policy: "Packages which use Internet resources should fail gracefully with an informative message if the resource is not available or has changed (and not give a check warning nor error)."

Changes

  • New safe_http() helper (R/utils-http.R) — single tryCatch owner for all HTTP calls; connection-level errors (DNS failure, timeout, refused) emit message() and return invisible(NULL) instead of propagating as errors
  • All 22 HTTP-calling functions updated to use safe_http() and replace stop() with message() for HTTP-level failures
  • Bug fixes found during code review:
    • pons_translate(): is.vector() → length() > 1 (scalar branch was dead code)
    • google_translate() vector path: missing NULL guard added
    • apertium_translate() vector path: NULL → NA_character_ in sapply to preserve character vector type
    • create_translation_table() / create_transliteration_table(): handle NULL returns inside map_chr
    • translate_to_morse(), translate_to_morse_audio(), google_translate_long_text(): were missed in initial pass, now covered
  • wikipedia_get_language_names() example wrapped in \donttest{}
  • .claude added to .Rbuildignore