This PR potentially fix the issue of tmp file not properly cleared after a failed scan, leading to: ENOSPC: no space left on device, mkdir '/tmp/tmp-8-bsc9NMF2bYaq'
Here's a brief summary of the changes:
Added a try-catch block to the async function to ensure all exceptions are caught and handled appropriately.
Upon an error, the browser is closed to free up resources. User data directory and output directory are cleared in case of an error to ensure no data remains.
In the case of an error, the function now returns an object with status 'failed' and a message indicating that the run failed. Finally, it will make sure to clean tmp directories to handle the next scan.
This PR potentially fix the issue of tmp file not properly cleared after a failed scan, leading to:
ENOSPC: no space left on device, mkdir '/tmp/tmp-8-bsc9NMF2bYaq'
Here's a brief summary of the changes:
try-catch
block to the async function to ensure all exceptions are caught and handled appropriately.example.ts
also got updated with error logging.