mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-08 04:22:09 +00:00
This PR fixes the formatting on several files that were never run through `prettier`. It also makes sure to run `prettier` in CI to to [fail fast](https://github.com/vercel/vercel/actions/runs/4408442998/jobs/7723453978) when the incorrect formatting is attempted.
24 lines
442 B
JavaScript
24 lines
442 B
JavaScript
const retry = require('async-retry');
|
|
|
|
function canRetry(error) {
|
|
error.dontBail = true;
|
|
return error;
|
|
}
|
|
|
|
async function retryBailByDefault(fn, opts) {
|
|
return await retry(async () => {
|
|
try {
|
|
return await fn(canRetry);
|
|
} catch (error) {
|
|
if (error.dontBail) {
|
|
delete error.dontBail;
|
|
} else {
|
|
error.bail = true;
|
|
}
|
|
throw error;
|
|
}
|
|
}, opts);
|
|
}
|
|
|
|
module.exports = retryBailByDefault;
|