Open Dan-Shields opened 10 months ago
All of these functions follow this pattern:
try { return new Promise(resolve => { // ... do stuff resolve() ) } catch (error) { logger.error('spx.writeFile - Error while saving: ' + filepath + ': ' + error); return }
The try block will never fail, as the promise doesn't execute immediately
It should be:
return new Promise((resolve, reject) => { try { // ... do stuff resolve(); } catch (error) { logger.error('spx.duplicateFile - Error while duplicating: ' + fileRefe + ': ' + error); reject(); } })
I will keep these here as a reminder for a future update. Thanks for pointing this out!
All of these functions follow this pattern:
The try block will never fail, as the promise doesn't execute immediately
It should be: