[READ-ONLY] Mirror of https://github.com/FoxxMD/logging. A typed, opinionated, batteries-included, Pino-based logging solution for backend TS/JS projects foxxmd.github.io/logging
child-logger logging logging-library nodejs pinojs typescript-library
0

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #2 from jackwilsdon/fix-read-only-hang

fix: hang on read-only filesystems

authored by

Matt Foxx and committed by
GitHub
(Sep 11, 2024, 9:03 AM EDT) ff0e6dfe d778c2fc

+2 -2
+2 -2
src/util.ts
··· 15 15 let currPath = pathInfo; 16 16 let parentOK = false; 17 17 let accessError = null; 18 - while(currPath.dir !== '') { 18 + while(currPath.dir !== '' && currPath.dir !== '/') { 19 19 try { 20 20 accessSync(currPath.dir, constants.R_OK | constants.W_OK); 21 21 parentOK = true; ··· 31 31 if(parentOK) { 32 32 return true; 33 33 } 34 - if (accessError.code === 'EACCES') { 34 + if (!accessError || accessError.code === 'EACCES') { 35 35 // also can't access directory :( 36 36 throw new Error(`No ${isDir ? 'directory' : 'file'} exists at ${location} and application does not have permission to write to the parent directory`); 37 37 } else {