{"action":"opened","issue":{"url":"https://api.github.com/repos/patriksimek/connect-mssql/issues/12","repository_url":"https://api.github.com/repos/patriksimek/connect-mssql","labels_url":"https://api.github.com/repos/patriksimek/connect-mssql/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/patriksimek/connect-mssql/issues/12/comments","events_url":"https://api.github.com/repos/patriksimek/connect-mssql/issues/12/events","html_url":"https://github.com/patriksimek/connect-mssql/issues/12","id":176291402,"number":12,"title":"Can't throw error on db connect","user":{"login":"WindWen","id":12590228,"avatar_url":"https://avatars.githubusercontent.com/u/12590228?v=3","gravatar_id":"","url":"https://api.github.com/users/WindWen","html_url":"https://github.com/WindWen","followers_url":"https://api.github.com/users/WindWen/followers","following_url":"https://api.github.com/users/WindWen/following{/other_user}","gists_url":"https://api.github.com/users/WindWen/gists{/gist_id}","starred_url":"https://api.github.com/users/WindWen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WindWen/subscriptions","organizations_url":"https://api.github.com/users/WindWen/orgs","repos_url":"https://api.github.com/users/WindWen/repos","events_url":"https://api.github.com/users/WindWen/events{/privacy}","received_events_url":"https://api.github.com/users/WindWen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-12T04:14:54Z","updated_at":"2016-09-12T04:14:54Z","closed_at":null,"body":"Can't throw error if i use a error password\r\n\r\n```javascript\r\n\r\nvar mssql_config = {\r\n    user: 'test_dba',\r\n    password: 'xxxxxx',\r\n    server: 'xxx.xxx.xxx.xx', // You can use 'localhost\\\\instance' to connect to named instance\r\n    database: 'ASPState'\r\n}\r\n\r\nvar store = new MSSQLStore(mssql_config);\r\n\r\nstore.on('connect', function(err) {\r\n    console.log(err);\r\n});\r\n\r\nstore.on('error', function(err) {\r\n    console.log(err);\r\n});\r\n\r\napp.use(session({\r\n  store: store,\r\n  secret: 'keyboard cat'\r\n}))\r\n```\r\n\r\nThe event error or  connect can't output anything.\r\n\r\nYou should add catch on \"this.connection.connect()\" like this\r\n\r\n```javascript\r\n\r\nthis.connection.connect().then((function(_this) {\r\n  return function() {\r\n    if (_this.autoRemove === 'interval') {\r\n      _this.destroyExpired();\r\n      return setInterval(_this.destroyExpired.bind(_this), _this.autoRemoveInterval);\r\n    }\r\n  };\r\n})(this)).catch(this.emit.bind(this, 'error'));\r\n\r\n```\r\n\r\nSo please  fix this bug ~\r\n"}}
{"actor":{"display_login":"WindWen"}}