From 8c294d82e61c572f80e1b247981896ed5376fb12 Mon Sep 17 00:00:00 2001 From: Jacob Quinn Date: Sat, 9 Sep 2023 16:10:17 -0600 Subject: [PATCH] Fix a few typos (#1109) --- src/HTTP.jl | 2 +- src/clientlayers/ConnectionRequest.jl | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/HTTP.jl b/src/HTTP.jl index cc3d027b8..941bab9f5 100644 --- a/src/HTTP.jl +++ b/src/HTTP.jl @@ -113,7 +113,7 @@ as an additional keyword argument to the request. - any `AbstractString` or `AbstractVector{UInt8}` which will be sent "as is" for the request body - a readable `IO` stream or any `IO`-like type `T` for which `eof(T)` and `readavailable(T)` are defined. This stream will be read and sent until `eof` is `true`. - This object should support the `mark`/`reset` methods if request retires are desired (if not, no retries will be attempted). + This object should support the `mark`/`reset` methods if request retries are desired (if not, no retries will be attempted). - Any collection or iterable of the above (`AbstractDict`, `AbstractString`, `AbstractVector{UInt8}`, or `IO`) which will result in a "chunked" request body, where each iterated element will be sent as a separate chunk - a [`HTTP.Form`](@ref), which will be serialized as the "multipart/form-data" content-type diff --git a/src/clientlayers/ConnectionRequest.jl b/src/clientlayers/ConnectionRequest.jl index 4b69187f3..f26d7cb02 100644 --- a/src/clientlayers/ConnectionRequest.jl +++ b/src/clientlayers/ConnectionRequest.jl @@ -119,13 +119,14 @@ function connectionlayer(handler) stream = Stream(req.response, io) return handler(stream; readtimeout=readtimeout, logerrors=logerrors, logtag=logtag, kw...) catch e + shouldreuse = false # manually unwrap CompositeException since it's not defined as a "wrapper" exception by ExceptionUnwrapping while e isa CompositeException e = e.exceptions[1] end root_err = ExceptionUnwrapping.unwrap_exception_to_root(e) # don't log if it's an HTTPError since we should have already logged it - if logerrors && err isa StatusError + if logerrors && root_err isa StatusError err = current_exceptions_to_string() @error err type=Symbol("HTTP.StatusError") method=req.method url=req.url context=req.context logtag=logtag end @@ -133,8 +134,7 @@ function connectionlayer(handler) err = current_exceptions_to_string(e) @error err type=Symbol("HTTP.ConnectionRequest") method=req.method url=req.url context=req.context logtag=logtag end - @debugv 1 "❗️ ConnectionLayer $e. Closing: $io" - shouldreuse = false + @debugv 1 "❗️ ConnectionLayer $root_err. Closing: $io" if @isdefined(stream) && stream.nwritten == -1 # we didn't write anything, so don't need to worry about # idempotency of the request