feat: log more errors while s3

This commit is contained in:
max_richter 2025-01-26 18:07:41 +01:00
parent deb3bf4d94
commit 0f2b522b24

View File

@ -10,8 +10,14 @@ const minioClient = new Client({
secretKey: S3_SECRET_ACCESS_KEY,
})
export function putObject(fileName: string, content: Buffer, metadata: ItemBucketMetadata = {}) {
return minioClient.putObject(S3_BUCKET_NAME, fileName, content, metadata);
export async function putObject(fileName: string, content: Buffer, metadata: ItemBucketMetadata = {}) {
try {
const res = await minioClient.putObject(S3_BUCKET_NAME, fileName, content, metadata);
return res;
} catch (e) {
console.error(e);
return e;
}
}
export function listBuckets() {