handle error s3 upload
This commit is contained in:
parent
65672c9c52
commit
7c7c03a691
|
@ -373,8 +373,19 @@ export class DriveService {
|
|||
partSize: s3.endpoint.hostname === 'storage.googleapis.com' ? 500 * 1024 * 1024 : 8 * 1024 * 1024,
|
||||
});
|
||||
|
||||
const result = await upload.promise();
|
||||
if (result) this.registerLogger.debug(`Uploaded: ${result.Bucket}/${result.Key} => ${result.Location}`);
|
||||
await upload.promise()
|
||||
.then(
|
||||
result => {
|
||||
if (result) {
|
||||
this.registerLogger.debug(`Uploaded: ${result.Bucket}/${result.Key} => ${result.Location}`);
|
||||
} else {
|
||||
this.registerLogger.error(`Upload Result Empty: key = ${key}, filename = ${filename}`);
|
||||
}
|
||||
},
|
||||
err => {
|
||||
this.registerLogger.error(`Upload Failed: key = ${key}, filename = ${filename}`, err);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@bindThis
|
||||
|
|
Loading…
Reference in New Issue