stopIfHiveError: Terminate if an HTTP response is an error message

stopIfHiveErrorR Documentation

Terminate if an HTTP response is an error message

Description

This is a convenience function to terminate if the result of an HTTP request contains an error message.

Usage

stopIfHiveError(x)

Arguments

x

A variable returned by httpRequest

Details

The system may return a JSON-encoded list containing a single element, named error, containing an error message. If so, it is extracted to an error message during termination (see below).

Value

If the argument x is of class simpleError, the function processes the error message as needed and terminates with the error; otherwise, the argument x is returned.

Author(s)

Adam C. Gower agower@bu.edu


agower/GeneHive documentation built on April 14, 2022, 5:08 a.m.