Errors

Errors thrown by handtruck come in 3 flavors.

ConflictError

When an object is changed while a parallel upload/download is happening, a ConflictError is raised.

HTTPX Errors

When a transport (or something else outside of the S3 protocol) error occurs, the respective HTTPX error is raised.

S3Error

S3Error is used when an S3-level error occurs. It’s dynamically sublcassed based on the code of the error, and these are accessible from the handtruck.exceptions module.

These can be BucketNotFound or PreconditionFailed or BucketNotEmpty. See the AWS docs for the full list of names and their meanings.

For example:

try:
    await s3client.get(URL("s3://mybucket/object"))
except handtruck.exceptions.NoSuchKey:
    print("Object not found")
except handtruck.exceptions.NoSuchBucket:
    print("Bucket not found; misconfiguration?")