{"action":"closed","issue":{"url":"https://api.github.com/repos/nspragg/filehound/issues/74","repository_url":"https://api.github.com/repos/nspragg/filehound","labels_url":"https://api.github.com/repos/nspragg/filehound/issues/74/labels{/name}","comments_url":"https://api.github.com/repos/nspragg/filehound/issues/74/comments","events_url":"https://api.github.com/repos/nspragg/filehound/issues/74/events","html_url":"https://github.com/nspragg/filehound/issues/74","id":377109108,"node_id":"MDU6SXNzdWUzNzcxMDkxMDg=","number":74,"title":"Broken Symbolic Link Blows up Directory Search","user":{"login":"charliecalvert","id":1811478,"node_id":"MDQ6VXNlcjE4MTE0Nzg=","avatar_url":"https://avatars0.githubusercontent.com/u/1811478?v=4","gravatar_id":"","url":"https://api.github.com/users/charliecalvert","html_url":"https://github.com/charliecalvert","followers_url":"https://api.github.com/users/charliecalvert/followers","following_url":"https://api.github.com/users/charliecalvert/following{/other_user}","gists_url":"https://api.github.com/users/charliecalvert/gists{/gist_id}","starred_url":"https://api.github.com/users/charliecalvert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charliecalvert/subscriptions","organizations_url":"https://api.github.com/users/charliecalvert/orgs","repos_url":"https://api.github.com/users/charliecalvert/repos","events_url":"https://api.github.com/users/charliecalvert/events{/privacy}","received_events_url":"https://api.github.com/users/charliecalvert/received_events","type":"User","site_admin":false},"labels":[{"id":336212669,"node_id":"MDU6TGFiZWwzMzYyMTI2Njk=","url":"https://api.github.com/repos/nspragg/filehound/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"closed","locked":false,"assignee":{"login":"nspragg","id":5319732,"node_id":"MDQ6VXNlcjUzMTk3MzI=","avatar_url":"https://avatars2.githubusercontent.com/u/5319732?v=4","gravatar_id":"","url":"https://api.github.com/users/nspragg","html_url":"https://github.com/nspragg","followers_url":"https://api.github.com/users/nspragg/followers","following_url":"https://api.github.com/users/nspragg/following{/other_user}","gists_url":"https://api.github.com/users/nspragg/gists{/gist_id}","starred_url":"https://api.github.com/users/nspragg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nspragg/subscriptions","organizations_url":"https://api.github.com/users/nspragg/orgs","repos_url":"https://api.github.com/users/nspragg/repos","events_url":"https://api.github.com/users/nspragg/events{/privacy}","received_events_url":"https://api.github.com/users/nspragg/received_events","type":"User","site_admin":false},"assignees":[{"login":"nspragg","id":5319732,"node_id":"MDQ6VXNlcjUzMTk3MzI=","avatar_url":"https://avatars2.githubusercontent.com/u/5319732?v=4","gravatar_id":"","url":"https://api.github.com/users/nspragg","html_url":"https://github.com/nspragg","followers_url":"https://api.github.com/users/nspragg/followers","following_url":"https://api.github.com/users/nspragg/following{/other_user}","gists_url":"https://api.github.com/users/nspragg/gists{/gist_id}","starred_url":"https://api.github.com/users/nspragg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nspragg/subscriptions","organizations_url":"https://api.github.com/users/nspragg/orgs","repos_url":"https://api.github.com/users/nspragg/repos","events_url":"https://api.github.com/users/nspragg/events{/privacy}","received_events_url":"https://api.github.com/users/nspragg/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/nspragg/filehound/milestones/14","html_url":"https://github.com/nspragg/filehound/milestone/14","labels_url":"https://api.github.com/repos/nspragg/filehound/milestones/14/labels","id":3869327,"node_id":"MDk6TWlsZXN0b25lMzg2OTMyNw==","number":14,"title":"v1.16.5","description":null,"creator":{"login":"nspragg","id":5319732,"node_id":"MDQ6VXNlcjUzMTk3MzI=","avatar_url":"https://avatars2.githubusercontent.com/u/5319732?v=4","gravatar_id":"","url":"https://api.github.com/users/nspragg","html_url":"https://github.com/nspragg","followers_url":"https://api.github.com/users/nspragg/followers","following_url":"https://api.github.com/users/nspragg/following{/other_user}","gists_url":"https://api.github.com/users/nspragg/gists{/gist_id}","starred_url":"https://api.github.com/users/nspragg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nspragg/subscriptions","organizations_url":"https://api.github.com/users/nspragg/orgs","repos_url":"https://api.github.com/users/nspragg/repos","events_url":"https://api.github.com/users/nspragg/events{/privacy}","received_events_url":"https://api.github.com/users/nspragg/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":1,"state":"open","created_at":"2018-12-04T08:11:19Z","updated_at":"2018-12-04T18:10:07Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2018-11-04T00:58:23Z","updated_at":"2018-12-04T18:10:07Z","closed_at":"2018-12-04T18:10:07Z","author_association":"NONE","body":"### Description\r\n\r\nI don't know if this is a bug or not. Perhaps it is, perhaps you can help me see how I should be handling this exception when I get it. If you think it is up to me to handle the exception, if you can give a concrete example of how I should handle it, that would be appreciated. \r\n\r\nWhen searching for directories, if I hit a symbolic link that is bad, the search fails with \r\n\r\nError: ENOENT: no such file or directory, stat \r\n\r\n### Expected behaviour\r\n\r\nSkips broken link, or does something more benign than throwing exception that I can't quite see how to handle, perhaps because there is something about working with Promises that I don't understand.\r\n\r\n### Actual behaviour\r\n\r\nThrows exception\r\n\r\nHere is what happens when I hit a broken Symbolic Link called **NodeRouteBasics**.\r\n\r\n{ Error: ENOENT: no such file or directory, stat '/home/charlie/Git/isit320-2018/isit320-vincenzi-2018/aws-provision/server/NodeRouteBasics'\r\n    at Object.statSync (fs.js:848:3)\r\n    at File._getStatsSync (/media/charlie/elfdisk/Git/isit320-calvert-2018/aws-provision/node_modules/file-js/lib/file.js:50:28)\r\n    at File.isDirectorySync (/media/charlie/elfdisk/Git/isit320-calvert-2018/aws-provision/node_modules/file-js/lib/file.js:113:19)\r\n    at /media/charlie/elfdisk/Git/isit320-calvert-2018/aws-provision/node_modules/filehound/lib/filehound.js:723:18\r\n    at tryCatcher (/media/charlie/elfdisk/Git/isit320-calvert-2018/aws-provision/node_modules/bluebird/js/release/util.js:16:23)\r\n    at MappingPromiseArray._promiseFulfilled (/media/charlie/elfdisk/Git/isit320-calvert-2018/aws-provision/node_modules/bluebird/js/release/map.js:61:38)\r\n    at MappingPromiseArray.PromiseArray._iterate (/media/charlie/elfdisk/Git/isit320-calvert-2018/aws-provision/node_modules/bluebird/js/release/promise_array.js:114:31)\r\n    at MappingPromiseArray.init (/media/charlie/elfdisk/Git/isit320-calvert-2018/aws-provision/node_modules/bluebird/js/release/promise_array.js:78:10)\r\n    at Promise._settlePromise (/media/charlie/elfdisk/Git/isit320-calvert-2018/aws-provision/node_modules/bluebird/js/release/promise.js:566:21)\r\n    at Promise._settlePromise0 (/media/charlie/elfdisk/Git/isit320-calvert-2018/aws-provision/node_modules/bluebird/js/release/promise.js:614:10)\r\n    at Promise._settlePromises (/media/charlie/elfdisk/Git/isit320-calvert-2018/aws-provision/node_modules/bluebird/js/release/promise.js:694:18)\r\n    at Promise._fulfill (/media/charlie/elfdisk/Git/isit320-calvert-2018/aws-provision/node_modules/bluebird/js/release/promise.js:638:18)\r\n    at Promise._resolveCallback (/media/charlie/elfdisk/Git/isit320-calvert-2018/aws-provision/node_modules/bluebird/js/release/promise.js:432:57)\r\n    at Promise._settlePromiseFromHandler (/media/charlie/elfdisk/Git/isit320-calvert-2018/aws-provision/node_modules/bluebird/js/release/promise.js:524:17)\r\n    at Promise._settlePromise (/media/charlie/elfdisk/Git/isit320-calvert-2018/aws-provision/node_modules/bluebird/js/release/promise.js:569:18)\r\n    at Promise._settlePromise0 (/media/charlie/elfdisk/Git/isit320-calvert-2018/aws-provision/node_modules/bluebird/js/release/promise.js:614:10)\r\n  errno: -2,\r\n  syscall: 'stat',\r\n  code: 'ENOENT',\r\n  path:\r\n   '/home/charlie/Git/isit320-2018/isit320-vincenzi-2018/aws-provision/server/NodeRouteBasics' }\r\n\r\n\r\n### Steps to reproduce\r\n\r\nHere is my code:\r\n\r\n`const filehound = FileHound.create();\r\n\r\n    filehound\r\n        .path(searchDir)\r\n        .depth(1)\r\n        .discard([\"node_modules\", \"bower_components\", \"build\", \".idea\", \"static\", \".git\"])\r\n        .directory()\r\n        .find((err, dirs) => {\r\n            if (err) {\r\n                console.log(err);\r\n            }\r\n            if (!dirs) {\r\n                console.log('SEARCHDIR'.red, searchDir);\r\n                return;\r\n            } else {\r\n                console.log('SEARCHDIR'.blue, searchDir);\r\n            }`\r\n\r\nWhen I hit the broken link **err** is valid and **!dirs** is **true**.\r\n\r\n### Operating system\r\n\r\nLinux Ubuntu 18.04\r\n"}}
{"actor":{"display_login":"nspragg"}}