yield* s3.headObject({ Bucket: config.bucketName, Key: path }).pipe(
Effect.catchTag("NotFound", (err) =>
Effect.fail(
SystemError({module: "FileSystem", method: "access", reason: "NotFound", message: err.message, pathOrDescriptor: path }),
)),
Effect.catchAll((err) =>
Effect.fail(
SystemError({module: "FileSystem", method: "access", reason: "Unknown", message: err.message, pathOrDescriptor: path }),
)
),
);
yield* s3.headObject({ Bucket: config.bucketName, Key: path }).pipe(
Effect.catchTag("NotFound", (err) =>
Effect.fail(
SystemError({module: "FileSystem", method: "access", reason: "NotFound", message: err.message, pathOrDescriptor: path }),
)),
Effect.catchAll((err) =>
Effect.fail(
SystemError({module: "FileSystem", method: "access", reason: "Unknown", message: err.message, pathOrDescriptor: path }),
)
),
);