% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/error_http_generated.R, R/s3-classes.R
\name{http100}
\alias{http100}
\alias{http101}
\alias{http102}
\alias{http200}
\alias{http201}
\alias{http202}
\alias{http203}
\alias{http204}
\alias{http205}
\alias{http206}
\alias{http207}
\alias{http208}
\alias{http226}
\alias{http300}
\alias{http301}
\alias{http302}
\alias{http303}
\alias{http304}
\alias{http305}
\alias{http306}
\alias{http307}
\alias{http308}
\alias{http400}
\alias{http401}
\alias{http402}
\alias{http403}
\alias{http404}
\alias{http405}
\alias{http406}
\alias{http407}
\alias{http408}
\alias{http409}
\alias{http410}
\alias{http411}
\alias{http412}
\alias{http413}
\alias{http414}
\alias{http415}
\alias{http416}
\alias{http417}
\alias{http418}
\alias{http419}
\alias{http420}
\alias{http422}
\alias{http423}
\alias{http424}
\alias{http425}
\alias{http426}
\alias{http428}
\alias{http429}
\alias{http431}
\alias{http440}
\alias{http444}
\alias{http449}
\alias{http450}
\alias{http451}
\alias{http494}
\alias{http495}
\alias{http496}
\alias{http497}
\alias{http498}
\alias{http499}
\alias{http500}
\alias{http501}
\alias{http502}
\alias{http503}
\alias{http504}
\alias{http505}
\alias{http506}
\alias{http507}
\alias{http508}
\alias{http509}
\alias{http510}
\alias{http511}
\alias{http598}
\alias{http599}
\alias{http}
\title{higher level error wrappers}
\usage{
http100(response, behavior = "stop", message_template)

http101(response, behavior = "stop", message_template)

http102(response, behavior = "stop", message_template)

http200(response, behavior = "stop", message_template)

http201(response, behavior = "stop", message_template)

http202(response, behavior = "stop", message_template)

http203(response, behavior = "stop", message_template)

http204(response, behavior = "stop", message_template)

http205(response, behavior = "stop", message_template)

http206(response, behavior = "stop", message_template)

http207(response, behavior = "stop", message_template)

http208(response, behavior = "stop", message_template)

http226(response, behavior = "stop", message_template)

http300(response, behavior = "stop", message_template)

http301(response, behavior = "stop", message_template)

http302(response, behavior = "stop", message_template)

http303(response, behavior = "stop", message_template)

http304(response, behavior = "stop", message_template)

http305(response, behavior = "stop", message_template)

http306(response, behavior = "stop", message_template)

http307(response, behavior = "stop", message_template)

http308(response, behavior = "stop", message_template)

http400(response, behavior = "stop", message_template)

http401(response, behavior = "stop", message_template)

http402(response, behavior = "stop", message_template)

http403(response, behavior = "stop", message_template)

http404(response, behavior = "stop", message_template)

http405(response, behavior = "stop", message_template)

http406(response, behavior = "stop", message_template)

http407(response, behavior = "stop", message_template)

http408(response, behavior = "stop", message_template)

http409(response, behavior = "stop", message_template)

http410(response, behavior = "stop", message_template)

http411(response, behavior = "stop", message_template)

http412(response, behavior = "stop", message_template)

http413(response, behavior = "stop", message_template)

http414(response, behavior = "stop", message_template)

http415(response, behavior = "stop", message_template)

http416(response, behavior = "stop", message_template)

http417(response, behavior = "stop", message_template)

http418(response, behavior = "stop", message_template)

http419(response, behavior = "stop", message_template)

http420(response, behavior = "stop", message_template)

http422(response, behavior = "stop", message_template)

http423(response, behavior = "stop", message_template)

http424(response, behavior = "stop", message_template)

http425(response, behavior = "stop", message_template)

http426(response, behavior = "stop", message_template)

http428(response, behavior = "stop", message_template)

http429(response, behavior = "stop", message_template)

http431(response, behavior = "stop", message_template)

http440(response, behavior = "stop", message_template)

http444(response, behavior = "stop", message_template)

http449(response, behavior = "stop", message_template)

http450(response, behavior = "stop", message_template)

http451(response, behavior = "stop", message_template)

http494(response, behavior = "stop", message_template)

http495(response, behavior = "stop", message_template)

http496(response, behavior = "stop", message_template)

http497(response, behavior = "stop", message_template)

http498(response, behavior = "stop", message_template)

http499(response, behavior = "stop", message_template)

http500(response, behavior = "stop", message_template)

http501(response, behavior = "stop", message_template)

http502(response, behavior = "stop", message_template)

http503(response, behavior = "stop", message_template)

http504(response, behavior = "stop", message_template)

http505(response, behavior = "stop", message_template)

http506(response, behavior = "stop", message_template)

http507(response, behavior = "stop", message_template)

http508(response, behavior = "stop", message_template)

http509(response, behavior = "stop", message_template)

http510(response, behavior = "stop", message_template)

http511(response, behavior = "stop", message_template)

http598(response, behavior = "stop", message_template)

http599(response, behavior = "stop", message_template)

http(response, behavior = "stop", message_template)
}
\arguments{
\item{response}{The result of a call via \pkg{crul}, \pkg{curl}, or
\pkg{httr}}

\item{behavior}{Behavior of the error. See Details}

\item{message_template}{A message template. optional. use whisker
templating. names to use are: reason and status. use in template
like \code{\{\{reason\}\}} and  \code{\{\{status\}\}}. Note that
\code{\{\{message\}\}} that is used in \code{message_template_verbose}
will be ignored here.}
}
\description{
higher level error wrappers
}
\note{
These \code{http*} methods only use \code{$do} and not 
\code{$do_verbose}.
}
\section{behavior parameter options}{

\itemize{
 \item stop - stop on error
 \item warning - warning on error
 \item message - message on error
}
}

\section{using package \pkg{curl}}{

curl reponses are simple lists, so we have little to go on to make sure
it's a response from the \pkg{curl} package. We check for list names
internally but of course you could pass in a list with the right named
elements, while the values are complete nonsense, in which case
we'll probably fail badly. There's not much we can do.
}

\examples{
if (requireNamespace("crul")) {
 library("crul")
 res <- HttpClient$new("https://httpbin.org/status/418")$get()
 \dontrun{http(res)}
 http(res, behavior = "warning")
 http(res, behavior = "message")

 res <- HttpClient$new("https://httpbin.org/status/414")$get()
 \dontrun{http414(res)}
 http(res, behavior = "warning")
 http(res, behavior = "message")

 res <- HttpClient$new("https://httpbin.org/asdfafadsf")$get()
 \dontrun{http404(res)}
 http(res, behavior = "warning")
 http(res, behavior = "message")
}

if (requireNamespace("curl")) {
 library("curl")
 h <- curl::new_handle()
 curl::handle_setopt(h)
 res <- curl::curl_fetch_memory("https://httpbin.org/status/418", h)
 \dontrun{http(res)}
 http(res, behavior = "warning")
 http(res, behavior = "message")
}

if (requireNamespace("httr")) {
 library("httr")
 res <- GET("https://httpbin.org/status/418")
 \dontrun{http(res)}
 http(res, behavior = "warning")
 http(res, behavior = "message")
}
}
\seealso{
\code{\link{Error}}, \code{\link[fauxpas]{Error-Classes}}
}
