{"action":"created","issue":{"url":"https://api.github.com/repos/getsentry/raven-node/issues/138","repository_url":"https://api.github.com/repos/getsentry/raven-node","labels_url":"https://api.github.com/repos/getsentry/raven-node/issues/138/labels{/name}","comments_url":"https://api.github.com/repos/getsentry/raven-node/issues/138/comments","events_url":"https://api.github.com/repos/getsentry/raven-node/issues/138/events","html_url":"https://github.com/getsentry/raven-node/issues/138","id":126197793,"number":138,"title":"patchGlobal() callback does not fire when client is disabled","user":{"login":"mikeybtn","id":9271217,"avatar_url":"https://avatars.githubusercontent.com/u/9271217?v=3","gravatar_id":"","url":"https://api.github.com/users/mikeybtn","html_url":"https://github.com/mikeybtn","followers_url":"https://api.github.com/users/mikeybtn/followers","following_url":"https://api.github.com/users/mikeybtn/following{/other_user}","gists_url":"https://api.github.com/users/mikeybtn/gists{/gist_id}","starred_url":"https://api.github.com/users/mikeybtn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikeybtn/subscriptions","organizations_url":"https://api.github.com/users/mikeybtn/orgs","repos_url":"https://api.github.com/users/mikeybtn/repos","events_url":"https://api.github.com/users/mikeybtn/events{/privacy}","received_events_url":"https://api.github.com/users/mikeybtn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-01-12T14:58:47Z","updated_at":"2016-12-23T23:36:57Z","closed_at":null,"body":"In the following example, the callback will never fire:\n\n``` js\nvar dsn = false;  // disabled\nvar client = new raven.Client(dsn);\n\nclient.patchGlobal(function() {\n  console.log('Uncaught exception, aborting!');\n  process.exit(1);\n});\n```\n\nWe were treating the callback passed to `client.patchGlobal` as our process's default uncaught exception handler, expecting it to be invoked regardless of whether the sentry client is reporting, so this behavior was a little surprising.\n\nPotential improvements:\n- Always fire the callback, adding a `result` parameter which indicates whether anything was logged.\n- Just document the behavior: If the client is disabled, the callback will never fire.\n\nI'm happy to prepare a patch if there's a recommendation. Thanks!\n"},"comment":{"url":"https://api.github.com/repos/getsentry/raven-node/issues/comments/269057015","html_url":"https://github.com/getsentry/raven-node/issues/138#issuecomment-269057015","issue_url":"https://api.github.com/repos/getsentry/raven-node/issues/138","id":269057015,"user":{"login":"migueloller","id":5677929,"avatar_url":"https://avatars.githubusercontent.com/u/5677929?v=3","gravatar_id":"","url":"https://api.github.com/users/migueloller","html_url":"https://github.com/migueloller","followers_url":"https://api.github.com/users/migueloller/followers","following_url":"https://api.github.com/users/migueloller/following{/other_user}","gists_url":"https://api.github.com/users/migueloller/gists{/gist_id}","starred_url":"https://api.github.com/users/migueloller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/migueloller/subscriptions","organizations_url":"https://api.github.com/users/migueloller/orgs","repos_url":"https://api.github.com/users/migueloller/repos","events_url":"https://api.github.com/users/migueloller/events{/privacy}","received_events_url":"https://api.github.com/users/migueloller/received_events","type":"User","site_admin":false},"created_at":"2016-12-23T23:36:57Z","updated_at":"2016-12-23T23:36:57Z","body":"Now that `patchGlobal` is `install`, what should we do?\r\n\r\nIt would make sense that the callback is called even if the event isn't sent to Sentry because of what @LoicMahieu mentioned [here](https://github.com/getsentry/raven-node/issues/138#issuecomment-205282008).\r\n\r\nAlso, the arguments passed to the callback should be documented. It looks like the error is being passed somewhere in there, which could be used for logging and avoid the error from happening silently."}}
{"actor":{"display_login":"migueloller"}}