mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Add error handler to download stream lovell/sharp-libvips#14
This commit is contained in:
@@ -79,7 +79,9 @@ try {
|
||||
if (response.statusCode !== 200) {
|
||||
throw new Error(`Status ${response.statusCode}`);
|
||||
}
|
||||
response.pipe(tmpFile);
|
||||
response
|
||||
.on('error', fail)
|
||||
.pipe(tmpFile);
|
||||
});
|
||||
tmpFile
|
||||
.on('error', fail)
|
||||
|
||||
Reference in New Issue
Block a user