Skip to content

Commit

Permalink
Add http-requester/exn
Browse files Browse the repository at this point in the history
  • Loading branch information
jackfirth committed Aug 9, 2015
1 parent 13c4eca commit c92904d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions request/private/exn.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

(require fancy-app
"struct.rkt"
"base.rkt"
"wrap.rkt"
"call-response.rkt")

(provide (struct-out exn:fail:network:http:code)
requester-http-exn
http-requester/exn
http-exn-of-code?)


Expand Down Expand Up @@ -57,3 +59,4 @@
(http-response-body handler-response))

(define requester-http-exn (wrap-requester-response parse-response _))
(define http-requester/exn (requester-http-exn http-requester))
6 changes: 6 additions & 0 deletions request/private/exn.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
is thrown which contains the code and response body.
}

@defrequester[http-requester/exn]{
Like @racket[http-requester], but throws exceptions for failure codes
and returns the http response body as it's response. Equivalent to
@racket[(requester-http-exn http-requester)].
}

@defproc[(http-exn-of-code? [code exact-positive-integer?]
[v any/c])
boolean?]{
Expand Down

0 comments on commit c92904d

Please sign in to comment.