Extract the http status code and convert it into a human readable message. Give warning if has an error.

apiCheckStatus(x)

Arguments

x

A response() object or a number.

Value

FALSE if has an error, otherwise TRUE.

Examples

flightscanner:::apiCheckStatus(200L)
#> [1] TRUE
flightscanner:::apiCheckStatus(404L)
#> Warning: Client error: (404) Not Found
#> [1] FALSE