log_llm_error: Log LLMR Errors

View source: R/LLM_robust_utils.R

log_llm_errorR Documentation

Log LLMR Errors

Description

Logs an error with a timestamp for troubleshooting.

Usage

log_llm_error(err)

Arguments

err

An error object.

Value

Invisibly returns NULL.

Examples

## Not run: 
  # Example of logging an error by catching a failure. The variable name
  # below is deliberately one that is not set in the environment, so the
  # call fails locally with a "Missing API key" authentication error.
  config_test <- llm_config(
    provider = "groq",
    model = "openai/gpt-oss-20b",
    api_key = "LLMR_UNSET_DEMO_KEY",
    temperature = 0.5,
    max_tokens = 30
  )

  tryCatch(
    call_llm(config_test, list(list(role = "user", content = "Hello world!"))),
    error = function(e) log_llm_error(e)
  )

## End(Not run)

LLMR documentation built on July 11, 2026, 1:06 a.m.