CanardAbsurd signals R conditions with machine-readable subclasses and
fields. Errors inherit from canard_error, error and condition.
Details
canard_input_error: invalid arguments, rejected before any database effect.input_classnames the S7 constructor andparentholds the validation failure. Its subclasscanard_value_errorreports an unsupported value; see ca_values.canard_storage_error: a failed SQL operation, carryingoperation,attempts,elapsedseconds and the DBI condition inparent. Its subclasses arecanard_conflict(a known write conflict, whosemessage_basedflag isTRUEwhen the compatibility adapter below classified it),canard_lease_lost(the claim is gone; addsidandattempt),canard_restore_error(a stored value would not decode as its recorded R type; addsid),canard_failure_recording_error(a handler failed and recording it failed too, kept inparentandpersistence_error), andcanard_protocol_error.canard_spawn_conflict: theidalready holds a different submission.canard_result_error: the task is unknown or unfinished; carriesidandstate. Seeca_result().canard_replay_error: a step name repeated within an attempt, or its kind changed; carriesidandname.canard_process_error: a command fromca_process()failed or timed out; carriesid,status(NAon timeout) and thedirectoryholding logs.canard_close_error:ca_close()released everything it owns, but some step failed;errorslists them andparentis the first.canard_schema_errorcarries the unsupportedversion,canard_extension_errorthe load failure inparent, andcanard_coordinator_errorandcanard_connection_errorreport a coordinator called on the wrong or closed handle.
Two conditions are notifications rather than errors. canard_suspended
unwinds to ca_run() once ca_sleep() has saved a suspension, so an ordinary
error handler does not swallow it. canard_retryable announces a known write
conflict before it is raised: a withCallingHandlers() handler may wait and
invoke the canard_retry restart to repeat that one SQL statement, never an R
callback. ca_work() does this by default and signals
canard_conflict_retry (conflict, attempts, delay) before each retry;
conflict_retries = 0 leaves the policy to you. Handlers that return without
restarting, and errors they raise, propagate to the caller.
Unless given on_result, ca_work() warns about a handler failure with
canard_task_failed, keeping the condition in parent and the attempt record
in outcome.
Released DuckDB R and Quack builds discard the structured type of some errors
(https://github.com/duckdb/duckdb-r/issues/2711,
https://github.com/duckdb/duckdb-quack/pull/212). Until the installed
versions carry both fixes, write conflicts are recognized from exact tested
message text, which depends on upstream wording rather than a stable protocol.
Structured non-transaction errors take precedence over text, and unrecognized
messages never become retryable. See vignette("durability").