Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to do error handling with paws? #5

Open
sckott opened this issue Oct 10, 2023 · 1 comment
Open

How to do error handling with paws? #5

sckott opened this issue Oct 10, 2023 · 1 comment
Milestone

Comments

@sckott
Copy link
Member

sckott commented Oct 10, 2023

Some error messages that I've seen thus far in paws are not going to be useful to the typical sixtyfour user. e.g.,

Below, probably users won't be familiar with http status codes, though I know that a 404 means not found, so I can intuit that something wasn't found, but was it the bucket or the key? In addition, the error message is not useful to the user at all.

aws_file_attr(bucket = "s64-test-2", key = "doesntexist")
#> Error: SerializationError (HTTP 404). failed to read from query HTTP response body

Though sometimes the error messages are good:

aws_bucket_list_objects(bucket="s64-test-211")
#> Error: NoSuchBucket (HTTP 404). The specified bucket does not exist

and another good error message

desc_file <- file.path(system.file(), "DESCRIPTION")
aws_file_upload(bucket = "not-a-bucket", path = desc_file)
#> Error: BucketAlreadyExists (HTTP 409). The requested bucket name is not available. 
#> The bucket namespace is shared by all users of the system. Please select a different name and try again.

@seankross just a placeholder to maybe deal with this, any thoughts welcome

@sckott sckott added this to the v0.2 milestone Jan 10, 2024
@sckott
Copy link
Member Author

sckott commented Jul 24, 2024

Where we're doing an operation with files, we could first check if the bucket the file(s) are in exists and give an error message saying so. The error when a bucket doesn't exist I think is usually a 403, which is fine and correct, but isn't helpful to users. We could deal with this by catching the 403 and when it happens telling the user X bucket doesn't exist, or likely doesn't exist at least?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant