Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
mwarnerdotme committed Dec 30, 2021
1 parent ad027a5 commit d25a753
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/vite/src/client/client.ts
Expand Up @@ -210,8 +210,10 @@ async function waitForSuccessfulPing(ms = 1000) {
try {
const pingResponse = await fetch(`${base}__vite_ping`)

if (pingResponse.ok) break // success - 2xx status code
else throw new Error() // failure - non-2xx status code
// success - 2xx status code
if (pingResponse.ok) break
// failure - non-2xx status code
else throw new Error()
} catch (e) {
// wait ms before attempting to ping again
await new Promise((resolve) => setTimeout(resolve, ms))
Expand Down

0 comments on commit d25a753

Please sign in to comment.