awscr-s3 icon indicating copy to clipboard operation
awscr-s3 copied to clipboard

Error handling for non amazon s3 providers.

Open didactic-drunk opened this issue 5 years ago • 1 comments

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...

didactic-drunk avatar May 03 '20 08:05 didactic-drunk

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.

taylorfinnell avatar Feb 10 '21 02:02 taylorfinnell