{"action":"created","issue":{"url":"https://api.github.com/repos/Level/levelup/issues/406","repository_url":"https://api.github.com/repos/Level/levelup","labels_url":"https://api.github.com/repos/Level/levelup/issues/406/labels{/name}","comments_url":"https://api.github.com/repos/Level/levelup/issues/406/comments","events_url":"https://api.github.com/repos/Level/levelup/issues/406/events","html_url":"https://github.com/Level/levelup/issues/406","id":183027491,"number":406,"title":"Parameter sanity checking: ","user":{"login":"martinheidegger","id":914122,"avatar_url":"https://avatars.githubusercontent.com/u/914122?v=3","gravatar_id":"","url":"https://api.github.com/users/martinheidegger","html_url":"https://github.com/martinheidegger","followers_url":"https://api.github.com/users/martinheidegger/followers","following_url":"https://api.github.com/users/martinheidegger/following{/other_user}","gists_url":"https://api.github.com/users/martinheidegger/gists{/gist_id}","starred_url":"https://api.github.com/users/martinheidegger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinheidegger/subscriptions","organizations_url":"https://api.github.com/users/martinheidegger/orgs","repos_url":"https://api.github.com/users/martinheidegger/repos","events_url":"https://api.github.com/users/martinheidegger/events{/privacy}","received_events_url":"https://api.github.com/users/martinheidegger/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-10-14T11:30:31Z","updated_at":"2016-10-14T13:07:23Z","closed_at":null,"body":"Through a bug search in https://github.com/Level/leveldown/issues/314#issuecomment-253770241 I found out that `callback` is not sanity checked and thus an error occured if a value other than a function is passed-in: [`lib/levelup.js#L34`](https://github.com/Level/levelup/blob/90a4c5b45aecc8258f6277e9a0c5c48afcc09511/lib/levelup.js#L34)\r\n\r\nA random exception is thrown with a missing callback:\r\n\r\n```\r\n/Users/michaelnisi/node_modules/levelup/lib/levelup.js:284\r\n        callback()\r\n        ^\r\n\r\nTypeError: callback is not a function\r\n    at /Users/michaelnisi/node_modules/levelup/lib/levelup.js:284:9\r\n```\r\n\r\nIn order to provide a PR that handles this wrong argument I think it would be important to know if you its better that:\r\n\r\n 1. No error or warning should be shown if an argument could be resulting in an error _(the argument is ignored)_\r\n 2. An error should be immediately thrown when the argument could be resulting in an error\r\n 3. The requested command should not be executed but instead return to the callback with an error that contains informations regarding the invalid argument.\r\n 4. Current behaviour: fail loudly.\r\n "},"comment":{"url":"https://api.github.com/repos/Level/levelup/issues/comments/253794202","html_url":"https://github.com/Level/levelup/issues/406#issuecomment-253794202","issue_url":"https://api.github.com/repos/Level/levelup/issues/406","id":253794202,"user":{"login":"juliangruber","id":10247,"avatar_url":"https://avatars.githubusercontent.com/u/10247?v=3","gravatar_id":"","url":"https://api.github.com/users/juliangruber","html_url":"https://github.com/juliangruber","followers_url":"https://api.github.com/users/juliangruber/followers","following_url":"https://api.github.com/users/juliangruber/following{/other_user}","gists_url":"https://api.github.com/users/juliangruber/gists{/gist_id}","starred_url":"https://api.github.com/users/juliangruber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juliangruber/subscriptions","organizations_url":"https://api.github.com/users/juliangruber/orgs","repos_url":"https://api.github.com/users/juliangruber/repos","events_url":"https://api.github.com/users/juliangruber/events{/privacy}","received_events_url":"https://api.github.com/users/juliangruber/received_events","type":"User","site_admin":false},"created_at":"2016-10-14T13:07:23Z","updated_at":"2016-10-14T13:07:23Z","body":"I agree with the other maintainers, this is a pretty useful error to get"}}
{"actor":{"display_login":"juliangruber"}}