aws_error: Generate a classed http error

View source: R/error.R

aws_errorR Documentation

Generate a classed http error

Description

This function generates S3 error objects which are passed to stop() to generate classed errors. These can be used in conjunction with tryCatch() to respond differently to different types of failure.

Usage

aws_error(e, call = sys.call(-1), use_call = FALSE)

Arguments

e

An error struct, like ones generated by paws::Error. Must contain fields code (string),message (string), status_code (numeric), error_response (list).

call

The call stored in the condition object.

Details

This expands on the condition messages generated by the httr package in httr::http_condition(). In addition to error classes like http_error, http_400, and http_404, this sets attributes on the error condition that contain the unmarshaled error reponse from AWS for the respective service.

Value

An S3 object that inherits from (e.g.) condition, error, http_error, http_400 and http_404.

See Also

http://adv-r.had.co.nz/Exceptions-Debugging.html#condition-handling for more details about R's condition handling model https://github.com/r-lib/httr/blob/master/R/response-status.r#L310 for the httr inspiration of this condition


paws.common documentation built on Nov. 12, 2023, 1:08 a.m.