awscr-s3
awscr-s3 copied to clipboard
Error handling for non amazon s3 providers.
head_object raises XML::Exception. I think most providers use HTTP status codes for HEAD to indicate if an object exists or not.
All of the errors may have similar but I haven't had time to test them.
Tested with minio 2019-07...
It now raises Awscr::S3::Exception as of #66. It's probably only marginally better. It could be further improved to raise known exceptions (https://github.com/taylorfinnell/awscr-s3/blob/master/src/awscr-s3/exceptions.cr#L2) when they can be inferred from the http body and if they can't be inferred raise http based exceptions. Or, Awscr::S3::Exception could have the http status code attached to it.