getErrorDescription: Extract an error message from an http response.

View source: R/D1Node.R

getErrorDescriptionR Documentation

Extract an error message from an http response.

Description

Http requests can fail for a variety of reasons, so getErrorDescription first tries to determine what type of response was sent.

Usage

getErrorDescription(response)

Arguments

response

The httr response object to extract the error description from.

Details

The return types handled by this function are: o An incorrect url is sent to DataONE and an error is returned by the web server, not a specified DataONE service url. In this case, a generic error message may be returned, e.g. status=404, URL not found o A DataONE service was called, and returned an error message. In this case the DataONE response is parsed in an attempt to retrieve a meaningful error message.


dataone documentation built on June 11, 2022, 1:06 a.m.