Skip to content

Pipeline and external service failures

Source: R/errors-operations.R ยท Help: ?pipeline_errors

Errors raised by a pipeline step: a call to another service that failed, timed out, or was refused; an operation retried until the limit; and a read or write to storage that failed. All inherit from dataexcept_pipeline_error, and the four service errors from dataexcept_external_service_error too.

Usage

external_service_error(
  service_name,
  status_code = NULL,
  response = NULL,
  message = NULL,
  parent = NULL,
  call = NULL
)

service_timeout_error(
  service_name,
  timeout_seconds = NULL,
  parent = NULL,
  call = NULL
)

service_authentication_error(
  service_name,
  message = NULL,
  parent = NULL,
  call = NULL
)

service_authorization_error(
  service_name,
  message = NULL,
  parent = NULL,
  call = NULL
)

retry_limit_exceeded_error(
  operation,
  retries,
  message = NULL,
  parent = NULL,
  call = NULL
)

storage_error(location, operation, message = NULL, parent = NULL, call = NULL)

Arguments

service_name
Name of the service called.
status_code
The HTTP status code, if a response arrived.
response
The response, or part of it, stored as given. The envelope writes it as an attribute, so store only what is safe to log.
message
A message to use instead of the default.
parent
The condition that caused this one, or NULL.
call
The call to report, or NULL.
timeout_seconds
The time limit that elapsed, in seconds, or NULL.
operation
For retry_limit_exceeded_error(), the operation retried. For storage_error(), what was being done, such as "write".
retries
Number of attempts made.
location
Where the data was stored, such as a path or a bucket URL. A URL is redacted.

Value

A condition inheriting from dataexcept_pipeline_error.

Details

A refused credential or permission will be refused again, so service_authentication_error() and service_authorization_error() are permanent and not retryable. The others are "unknown": whether a retry would help depends on the service, and with_failure_metadata() records what it said.

Examples

call_rates_api <- function(status) {
  if (status == 401L) stop(service_authentication_error("rates-api"))
  if (status >= 500L) stop(external_service_error("rates-api", status_code = status))
  "ok"
}

err <- tryCatch(call_rates_api(401L), dataexcept_external_service_error = identity)
conditionMessage(err)
is_retryable(err)

err <- tryCatch(call_rates_api(503L), dataexcept_external_service_error = identity)
is_retryable(err)

storage_error("s3://reports/2026/q3.parquet", "write")

See also

Other dataexcept errors: data_engineering_errors, data_frame_errors, data_quality_errors, file_errors, job_errors, model_quality_errors, modelling_errors, service_errors, validation_error()