{"action":"created","issue":{"url":"https://api.github.com/repos/pozadi/kefir/issues/77","labels_url":"https://api.github.com/repos/pozadi/kefir/issues/77/labels{/name}","comments_url":"https://api.github.com/repos/pozadi/kefir/issues/77/comments","events_url":"https://api.github.com/repos/pozadi/kefir/issues/77/events","html_url":"https://github.com/pozadi/kefir/issues/77","id":65518418,"number":77,"title":"Error handling on a property requires that onError be defined first","user":{"login":"rooftopsparrow","id":853349,"avatar_url":"https://avatars.githubusercontent.com/u/853349?v=3","gravatar_id":"","url":"https://api.github.com/users/rooftopsparrow","html_url":"https://github.com/rooftopsparrow","followers_url":"https://api.github.com/users/rooftopsparrow/followers","following_url":"https://api.github.com/users/rooftopsparrow/following{/other_user}","gists_url":"https://api.github.com/users/rooftopsparrow/gists{/gist_id}","starred_url":"https://api.github.com/users/rooftopsparrow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rooftopsparrow/subscriptions","organizations_url":"https://api.github.com/users/rooftopsparrow/orgs","repos_url":"https://api.github.com/users/rooftopsparrow/repos","events_url":"https://api.github.com/users/rooftopsparrow/events{/privacy}","received_events_url":"https://api.github.com/users/rooftopsparrow/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-03-31T18:39:24Z","updated_at":"2015-03-31T19:24:30Z","closed_at":null,"body":"If a property has a current error:\r\n```js\r\nvar prop = getProp()\r\n{ _subscribers: { _items: [ [Object] ] },\r\n  _active: true,\r\n  _alive: true,\r\n  _current: [ '<nothing>' ],\r\n  _currentError: \r\n   { [NO_NODE: Exception: NO_NODE[-101]]\r\n     code: -101,\r\n     name: 'NO_NODE',\r\n     path: undefined,\r\n     message: 'Exception: NO_NODE[-101]' },\r\n  _source: \r\n   { _subscribers: { _items: [Object] },\r\n     _active: true,\r\n     _alive: true,\r\n     _queueLim: 0,\r\n     _concurLim: -1,\r\n     _drop: 'new',\r\n     '_$handleSubAny': [Function],\r\n     _queue: [],\r\n     _curSources: [],\r\n     _activating: false,\r\n     _source: \r\n      { _subscribers: [Object],\r\n        _active: true,\r\n        _alive: true,\r\n        _current: [Object],\r\n        _currentError: [Object],\r\n        _source: [Object],\r\n        _name: 'bus.toProperty.skipDuplicates.flatMapLatest.toProperty.filter.flatMapLatest.toProperty.map.skipDuplicates',\r\n        _fn: [Function: strictEqual],\r\n        _prev: [Object],\r\n        '_$handleAny': [Function] },\r\n     _fn: [Function],\r\n     _mainEnded: false,\r\n     _lastCurrent: null,\r\n     '_$handleMainSource': [Function],\r\n     _name: 'bus.toProperty.skipDuplicates.flatMapLatest.toProperty.filter.flatMapLatest.toProperty.map.skipDuplicates.flatMap' },\r\n  _name: 'bus.toProperty.skipDuplicates.flatMapLatest.toProperty.filter.flatMapLatest.toProperty.map.skipDuplicates.flatMap.toProperty',\r\n  '_$handleAny': [Function] }\r\n```\r\n\r\ndoing this doesn't log anything : \r\n\r\n```js\r\nprop.onValue(function(value){ console.log('got value', value) }).onError(function(err) { console.error('got error', err) })\r\n```\r\n\r\nbut doing this logs the \"got error\" message: \r\n\r\n```js\r\nprop.onError(function(err) { console.error('got error', err) }).onValue(function(value){ console.log('got value', value) })\r\n```\r\n\r\nIs there a reason why the first does not catch the error but the second does? `delay` says it doesn't delay errors either. Im not seeing a way to handle errors without explicitly handling them by binding the onError handler first.\r\n"},"comment":{"url":"https://api.github.com/repos/pozadi/kefir/issues/comments/88217823","html_url":"https://github.com/pozadi/kefir/issues/77#issuecomment-88217823","issue_url":"https://api.github.com/repos/pozadi/kefir/issues/77","id":88217823,"user":{"login":"rooftopsparrow","id":853349,"avatar_url":"https://avatars.githubusercontent.com/u/853349?v=3","gravatar_id":"","url":"https://api.github.com/users/rooftopsparrow","html_url":"https://github.com/rooftopsparrow","followers_url":"https://api.github.com/users/rooftopsparrow/followers","following_url":"https://api.github.com/users/rooftopsparrow/following{/other_user}","gists_url":"https://api.github.com/users/rooftopsparrow/gists{/gist_id}","starred_url":"https://api.github.com/users/rooftopsparrow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rooftopsparrow/subscriptions","organizations_url":"https://api.github.com/users/rooftopsparrow/orgs","repos_url":"https://api.github.com/users/rooftopsparrow/repos","events_url":"https://api.github.com/users/rooftopsparrow/events{/privacy}","received_events_url":"https://api.github.com/users/rooftopsparrow/received_events","type":"User","site_admin":false},"created_at":"2015-03-31T19:24:30Z","updated_at":"2015-03-31T19:24:30Z","body":"Found a case where this fails\r\n```\r\nvar Kefir = require('kefir')\r\nKefir.constantError('oh noes').\r\ntake(1).\r\nmap(function(x) {\r\n  return x\r\n}).flatMap(function(x) {\r\n  return Kefir.constant(x)\r\n}).onValue(function() {\r\n  console.log('got value')\r\n}).onError(function() {\r\n  console.error('got error')\r\n})\r\n```"}}