wrap fs.statSync in a try…catch