Error-Classes: Individual error classes

Description Details See Also Examples

Description

These error classes are for each HTTP error, and inherit from the Error class in this package.

Details

In addition to what's available in Error, these classes have a single variable mssg that is the very verbose complete message describing the HTTP condition in detail. You can include that message in your condition by using do_verbose (see below)

Methods

In addition to the methods documented in Error, these methods also have:

See Also

Error, http

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
if (requireNamespace("crul")) {

 library("crul")
 res <- HttpClient$new("https://httpbin.org/status/414")$get()
 x <- HTTPRequestURITooLong$new()
 x
 ## Not run: 
 x$do(res)
 x$do_verbose(res)
 
## End(Not run)

 # behavior
 x <- HTTPRequestURITooLong$new(behavior = "warning")
 ## Not run: 
 x$do(res)
 x$do_verbose(res)
 
## End(Not run)

 x <- HTTPRequestURITooLong$new(behavior = "message")
 ## Not run: 
 x$do(res)
 x$do_verbose(res)
 
## End(Not run)

 # with message template
 (x <- HTTPRequestURITooLong$new(
   message_template = "{{reason}} ............ {{status}}",
   message_template_verbose = "{{reason}} .>.>.>.>.>.> {{status}}\n {{message}}"
 ))
 ## Not run: 
 x$do(res)
 x$do_verbose(res)
 
## End(Not run)
}

fauxpas documentation built on April 14, 2020, 7:16 p.m.