mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 10:30:15 +02:00
Add error handler to download stream lovell/sharp-libvips#14
This commit is contained in:
parent
34d5252242
commit
a2aa7d69e7
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user