node-directory-tree icon indicating copy to clipboard operation
node-directory-tree copied to clipboard

Handle permission errors

Open GhyslainBruno opened this issue 8 years ago • 1 comments

Hi guys,

First of all thank you for your job, I currently am using your library and it's pretty powerfull.

I'm just wondering if there would be a way to handle permission errors with it ? (would be awesome)

Thanks for your reply,

Cheers !

GhyslainBruno avatar Jul 21 '17 09:07 GhyslainBruno

Hi! Glad it's useful! The code currently skips files without permission (https://github.com/mihneadb/node-directory-tree/blob/master/lib/directory-tree.js#L15). One option would be to add a callback like onError and leave the user to deal with that error. However, I'm wondering - how would you handle a permissions error?