Skip to content

Commit

Permalink
Merge #495
Browse files Browse the repository at this point in the history
495: Add AWSException fallback to replicate old constructor r=iamed2 a=iamed2

Fixes invenia/CloudWatchLogs.jl#40

When AWSResponse changes went in, a new field was added. CloudWatchLogs.jl tests relied on the default constructor, so when a field was added, tests broke. This adds a fallback that replicates the old constructor. It's also a reasonable fallback I think, given that the final field is optional (could be `nothing`). 

Co-authored-by: Eric Davies <iamed2@gmail.com>
  • Loading branch information
bors[bot] and iamed2 authored Oct 21, 2021
2 parents 059aae3 + 01776fe commit 5b138ee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/AWSExceptions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ struct AWSException <: Exception
streamed_body::Union{String,Nothing}
end

function AWSException(code, message, info, cause)
return AWSException(code, message, info, cause, nothing)
end

function Base.show(io::IO, e::AWSException)
print(io, AWSException, ": ", e.code)
!isempty(e.message) && print(io, " -- ", e.message)
Expand Down

0 comments on commit 5b138ee

Please sign in to comment.