diff --git a/src/garageS3.jl b/src/garageS3.jl index 1aecfd0..7086955 100644 --- a/src/garageS3.jl +++ b/src/garageS3.jl @@ -257,8 +257,12 @@ julia> data = String(get_file(storage, "test.json")) "\"{\\\"status\\\": \\\"active\\\"}\"" ``` """ -function get_file(storage::GarageStorage, key::String)::Vector{UInt8} - return AWSS3.s3_get(storage.config, storage.bucket, key) +function get_file(storage::GarageStorage, key::String)::Union{Vector{UInt8}, Nothing} + try + return AWSS3.s3_get(storage.config, storage.bucket, key) + catch + return nothing + end end """ List all object keys in the Garage S3 bucket.