Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
cacheReq.on('error', err => {
if (err instanceof CacheableRequest.RequestError) {
ee.emit('error', new got.RequestError(err, opts));
} else {
ee.emit('error', new got.CacheError(err, opts));
}
});
cacheReq.on('error', err => {
if (err instanceof CacheableRequest.RequestError) {
ee.emit('error', new got.RequestError(err, opts));
} else {
ee.emit('error', new got.CacheError(err, opts));
}
});
cacheRequest.once('error', error => {
if (error instanceof CacheableRequest.RequestError) {
emitError(new RequestError(error, options));
} else {
emitError(new CacheError(error, options));
}
});