xbioclim-messages: Error and Warning Message Store

xbioclim-messagesR Documentation

Error and Warning Message Store

Description

xbioclim mirrors the SpatMessages pattern from the terra package to provide a clean mechanism for propagating error and warning messages across the C++/R boundary.

How the cross-boundary workflow works:

  1. A C++ routine performs its computation and, instead of throwing directly, records any error or warning strings into a session-level message store.

  2. After every .Call() invocation, the R-side wrapper calls check_messages() to inspect the store and re-raise any messages as native R conditions (stop() for errors, warning() for warnings).

  3. Users can also inspect the store directly with bioclim_errors() and bioclim_warnings() before R conditions are raised, or clear it with clear_messages().

Functions available to users:

  • bioclim_errors() – retrieve stored error messages.

  • bioclim_warnings() – retrieve stored warning messages.

  • has_error() – TRUE if at least one error is stored.

  • has_warning() – TRUE if at least one warning is stored.

  • clear_messages() – discard all stored messages.

Functions used internally (and by future C++ glue code):

  • push_error() – store an error message.

  • push_warning() – store a warning message.

  • check_messages() – raise stored messages as R conditions and clear them.

Value

No return value; this page documents the internal message store. bioclim_errors() and bioclim_warnings() return character vectors, has_error() and has_warning() return logicals, and clear_messages() returns NULL invisibly.


xbioclim documentation built on Oct. 5, 2026, 5:08 p.m.