Skip to contents

Errors signalled by rtemis are classed R conditions, so they can be handled selectively with tryCatch() or withCallingHandlers() rather than matched by message text. Each error carries a class vector ordered from the most specific failure mode to the most general, so a handler can catch narrowly (e.g. only type errors) or broadly (e.g. any invalid input).

Every rtemis error inherits, in order: its specific class (when applicable), its category class, and finally "rtemis_error", "error", "condition". Catching rtemis_error therefore catches all rtemis errors.

Value

Not applicable. This page documents the condition classes; the functions that signal them do not return when they error.

Categories and specific classes

rtemis_input_error

A function argument supplied by the caller is invalid. Specific classes:

rtemis_type_error

Argument is of the wrong type or class.

rtemis_value_error

Argument has a disallowed value or choice.

rtemis_length_error

Argument has the wrong length or count.

rtemis_range_error

Argument is outside its allowed range.

rtemis_null_input

A required argument is NULL or empty.

rtemis_data_error

The supplied dataset is unsuitable for the requested operation. Specific classes:

rtemis_dim_error

Data has the wrong dimensions (e.g. too few columns).

rtemis_level_mismatch

Factor levels do not match across data splits.

rtemis_missing_data

Data contains missing values where none are allowed.

rtemis_outcome_error

The outcome column has an invalid or mismatched type.

rtemis_io_error

A filesystem operation failed. Specific classes:

rtemis_file_not_found

A path or file does not exist.

rtemis_file_exists

A file already exists and overwriting was not permitted.

rtemis_unsupported_error

The requested algorithm, feature, or combination is not supported (e.g. multiclass classification for an algorithm that only handles binary outcomes). No specific subclass.

rtemis_runtime_error

A model or algorithm call failed during execution. The original error is attached as the condition's $parent. No specific subclass.

See also

Author

EDG

Examples

# Every rtemis error inherits `rtemis_error`. Catch a category broadly:
result <- tryCatch(
  set_outcome(iris, "nonexistent_column"),
  rtemis_input_error = function(e) {
    message("Caught an input error: ", conditionMessage(e))
    NULL
  }
)
#> 2026-08-09 13:22:42 
#> ✖ rtemis_value_error
#>  [set_outcome]
#> Caught an input error: Column "nonexistent_column" not found in data.

# Or catch a specific failure mode only:
result <- tryCatch(
  set_outcome(iris, "nonexistent_column"),
  rtemis_value_error = function(e) {
    message("Caught a value error: ", conditionMessage(e))
    NULL
  }
)
#> 2026-08-09 13:22:42 
#> ✖ rtemis_value_error
#>  [set_outcome]
#> Caught a value error: Column "nonexistent_column" not found in data.