mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-02-13 10:52:53 +00: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,
|
||||
Key: p,
|
||||
})
|
||||
.on("error", (error) => {
|
||||
try {
|
||||
res.status(error.statusCode);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
})
|
||||
.on("httpHeaders", (statusCode, headers, response) => {
|
||||
res.status(statusCode);
|
||||
if (statusCode < 300) {
|
||||
|
||||
Reference in New Issue
Block a user