Skip to content

Commit

Permalink
Improve AWSException when streamed body is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
omus committed Sep 3, 2021
1 parent 5c90a4a commit bb045bf
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/AWSExceptions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,16 @@ function Base.show(io::IO, e::AWSException)
print(io, AWSException, ": ", e.code)
!isempty(e.message) && print(io, " -- ", e.message)
print(io, "\n\n", e.cause)
e.streamed_body !== nothing && print(io, "\n\n", e.streamed_body)

if e.streamed_body !== nothing
print(io, "\n\n")
if isempty(e.streamed_body)
printstyled(io, "(empty body)"; bold=true)
else
print(io, e.streamed_body)
end
end

println(io)
return nothing
end
Expand Down

0 comments on commit bb045bf

Please sign in to comment.