Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async onRequestFailed(pollyRequest, error) {
error = error || new PollyError('Request failed due to an unknown error.');
try {
await pollyRequest._emit('error', error);
await this.respondToRequest(pollyRequest, error);
} catch (e) {
// Rethrow any error not handled by `respondToRequest`.
throw e;
} finally {
pollyRequest.promise.reject(error);
}
}
}
get() {
throw new PollyError(
`You are trying to access an instance of Polly that is no longer available.\n` +
`See: https://netflix.github.io/pollyjs/#/test-frameworks/${framework}?id=test-hook-ordering`
);
}
});