Skip to content

Commit

Permalink
Merge ccf0a68 into 237b219
Browse files Browse the repository at this point in the history
  • Loading branch information
clement-buchart committed May 21, 2019
2 parents 237b219 + ccf0a68 commit 7bc7615
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.js
Expand Up @@ -186,7 +186,9 @@ class CacheableRequest {
}
};

this.cache.on('error', error => ee.emit('error', new CacheableRequest.CacheError(error)));
const errorHandler = error => ee.emit('error', new CacheableRequest.CacheError(error));
this.cache.once('error', errorHandler);
ee.on('response', _ => this.cache.removeListener('error', errorHandler));

try {
await get(opts);
Expand Down

0 comments on commit 7bc7615

Please sign in to comment.