mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-07-06 13:47:59 +02:00
fix: handle error while sending content from s3
This commit is contained in:
@@ -88,6 +88,13 @@ export default class S3Storage implements StorageBase {
|
|||||||
Bucket: config.S3_BUCKET,
|
Bucket: config.S3_BUCKET,
|
||||||
Key: p,
|
Key: p,
|
||||||
})
|
})
|
||||||
|
.on("error", (error) => {
|
||||||
|
try {
|
||||||
|
res.status(error.statusCode);
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
})
|
||||||
.on("httpHeaders", (statusCode, headers, response) => {
|
.on("httpHeaders", (statusCode, headers, response) => {
|
||||||
res.status(statusCode);
|
res.status(statusCode);
|
||||||
if (statusCode < 300) {
|
if (statusCode < 300) {
|
||||||
|
|||||||
Reference in New Issue
Block a user