This function interprets the meaning of the HTTP status and returns the elements needed to create an appropriate warning and return something meaningful to the user.

HTTPstatus(status)

Arguments

status

numeric, the error status

Value

A list of two elements. `warning` is used to create a warning message and `rtn` will be used to return to the user.

Details

Code 200 should not be sent to this function as this is only designed to handle the errors (>=400)

Examples

HTTPstatus(400)
#> $warning #> [1] "Pl@ntNet returned: Bad request" #> #> $rtn #> [1] "Bad request" #>