Skip to content

Commit

Permalink
fix: ignore system error of watch file
Browse files Browse the repository at this point in the history
  • Loading branch information
purocean committed Sep 29, 2023
1 parent 9133609 commit d9f90bf
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/renderer/plugins/watch-file-refresh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,15 @@ export default {
watchHandler?.abort()
}
},
async error => {
async (error) => {
logger.error('startWatch error', error)
// retry watch

// ignore system error
if ((error as any)?.syscall) {
return
}

// retry watch then other error occurred
await ctx.utils.sleep(2000)
triggerWatchFile(ctx.store.state.currentFile)
}
Expand Down

1 comment on commit d9f90bf

@vercel
Copy link

@vercel vercel bot commented on d9f90bf Sep 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.