Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
retries = 0;
}
if (retries === 0) {
return execute();
}
try {
return await pRetry(execute, {
retries
});
} catch (error) {
// Convenience wrapper for easier checks between network and GraphQL errors,
// since most applications won't actually differentiate between HTTP and timeout error types,
// however the original error is still accessible via `.originalError` property
if (error.name === HTTPError.name || error.name === TimeoutError.name) {
throw new NetworkError(error);
}
throw error;
}
}