{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angularfire2/issues/600","repository_url":"https://api.github.com/repos/angular/angularfire2","labels_url":"https://api.github.com/repos/angular/angularfire2/issues/600/labels{/name}","comments_url":"https://api.github.com/repos/angular/angularfire2/issues/600/comments","events_url":"https://api.github.com/repos/angular/angularfire2/issues/600/events","html_url":"https://github.com/angular/angularfire2/issues/600","id":181470327,"number":600,"title":"angularFire2 - ISSUES with error handling, exception handling  ??  :'(","user":{"login":"edoardoVD","id":21366085,"avatar_url":"https://avatars.githubusercontent.com/u/21366085?v=3","gravatar_id":"","url":"https://api.github.com/users/edoardoVD","html_url":"https://github.com/edoardoVD","followers_url":"https://api.github.com/users/edoardoVD/followers","following_url":"https://api.github.com/users/edoardoVD/following{/other_user}","gists_url":"https://api.github.com/users/edoardoVD/gists{/gist_id}","starred_url":"https://api.github.com/users/edoardoVD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edoardoVD/subscriptions","organizations_url":"https://api.github.com/users/edoardoVD/orgs","repos_url":"https://api.github.com/users/edoardoVD/repos","events_url":"https://api.github.com/users/edoardoVD/events{/privacy}","received_events_url":"https://api.github.com/users/edoardoVD/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-10-06T16:56:29Z","updated_at":"2016-10-06T21:07:49Z","closed_at":null,"body":"\r\n**AngularCli  1.0.0-beta.15\r\nAngular 2.0.0 (stable)\r\nangularFire2 2.0.0-beta5\r\nWindows 10\r\nChrome**\r\n\r\nWhen **valid value** is provided\r\n```\r\n_af  --->  AngularFireDatabase\r\n\r\nthis._af.list('attendees').push(someValidData)\r\n            .then(resolve => {\r\n                console.log('all good');\r\n            }, reject => {\r\n                console.log('error');\r\n            })\r\n            .catch(reject => {\r\n                console.log('catch');\r\n            });\r\n```\r\n**Console logs:      all good**\r\n\r\n--------------------------------------------------------\r\n\r\nWhen **INVALID value** is provided\r\n```\r\nthis._af.list('someList').push(null)\r\n            .then(resolve => {\r\n                console.log('all good');\r\n            }, reject => {\r\n                console.log('error');\r\n            })\r\n            .catch(reject => {\r\n                console.log('catch');\r\n            });\r\n\r\n```\r\n\r\n**error_handler.js:47 ORIGINAL EXCEPTION: this._af.list(...).push(...).then is not a function\r\nThen my angular2 app does some weird posting or refresh of the page**\r\n\r\nI have not seen found any of the documentation with examples of proper error handling.\r\n\r\nAccording to https://firebase.google.com/docs/database/web/save-data\r\nAnd since angular2 and angularFire2 implement use of Observables. I tried doing \r\n\r\n```\r\n\r\nlet result = this._af.list('someList').push(someData);\r\nreturn  Observable.fromPromise(result);\r\n```\r\n\r\n**But typescript tells me...**\r\nArgument of type 'ThenableReference' is not assignable to parameter of type 'Promise<any>'.\r\nProperty '[Symbol.toStringTa]' is missing in type ThenableReference\r\n\r\n\r\nThanks for any help/guidance provided\r\n\r\nRegards, \r\ne. Vazquez\r\n"},"comment":{"url":"https://api.github.com/repos/angular/angularfire2/issues/comments/252088978","html_url":"https://github.com/angular/angularfire2/issues/600#issuecomment-252088978","issue_url":"https://api.github.com/repos/angular/angularfire2/issues/600","id":252088978,"user":{"login":"edoardoVD","id":21366085,"avatar_url":"https://avatars.githubusercontent.com/u/21366085?v=3","gravatar_id":"","url":"https://api.github.com/users/edoardoVD","html_url":"https://github.com/edoardoVD","followers_url":"https://api.github.com/users/edoardoVD/followers","following_url":"https://api.github.com/users/edoardoVD/following{/other_user}","gists_url":"https://api.github.com/users/edoardoVD/gists{/gist_id}","starred_url":"https://api.github.com/users/edoardoVD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edoardoVD/subscriptions","organizations_url":"https://api.github.com/users/edoardoVD/orgs","repos_url":"https://api.github.com/users/edoardoVD/repos","events_url":"https://api.github.com/users/edoardoVD/events{/privacy}","received_events_url":"https://api.github.com/users/edoardoVD/received_events","type":"User","site_admin":false},"created_at":"2016-10-06T21:07:49Z","updated_at":"2016-10-06T21:07:49Z","body":"@DennisSmolek , @katowulf \r\n\r\n```\r\n ngOnInit() {\r\n    console.log('testing here');\r\n    var pushing = this._af.database.list('items').push(null);\r\n    console.log('push test', pushing);\r\n    console.log(typeof pushing);\r\n    }\r\n```\r\nfrom the looks of it the **catch func and then funcs** are Undefined, I guess thats the problem... . ?_?,  it seems that when the exception is thrown no call backs are attached who knows.... may its the cyber leprecauns ... \r\n\r\n![capture](https://cloud.githubusercontent.com/assets/21366085/19170512/f4e89aca-8bd5-11e6-9ec5-9ec5a92d78f0.PNG)\r\n\r\n\r\n"}}
{"actor":{"display_login":"edoardoVD"}}