Skip to content

Commit

Permalink
via templates
Browse files Browse the repository at this point in the history
  • Loading branch information
ikitommi committed Jan 1, 2025
1 parent b7169cc commit 7093e08
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/ring/util/http_response.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1144,7 +1144,7 @@

(defn network-read-timeout!
"598 Network read timeout (ServerError)
Throws an exception with ex-info:
{:type :ring.util.http-response/response
:response response}"
Expand All @@ -1166,7 +1166,7 @@

(defn network-connect-timeout!
"599 Network connect timeout (ServerError)
Throws an exception with ex-info:
{:type :ring.util.http-response/response
:response response}"
Expand Down
4 changes: 2 additions & 2 deletions templates/http-predicates.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
"Check whether the response type is {{type}} (status code is between
{{start}} and {{end}})."
[response]
{:pre (map? response)}
{:pre [(map? response)]}
(<= {{start}} (:status response) {{end}}))
{{/types}}{{#template}}
(defn {{fn-name}}?
"Checks whether the response has status code {{status}}"
[response]
{:pre (map? response)}
{:pre [(map? response)]}
(= (:status response) {{status}}))
{{/template}}
2 changes: 1 addition & 1 deletion templates/http-response.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{:type :ring.util.http-response/response
:response response}"
[response]
{:pre (map? response)}
{:pre [(map? response)]}
(throw (ex-info (str "HTTP "(:status response)) {:type ::response :response response})))
{{#template}}

Expand Down

0 comments on commit 7093e08

Please sign in to comment.