{"action":"created","issue":{"url":"https://api.github.com/repos/jashkenas/backbone/issues/3592","labels_url":"https://api.github.com/repos/jashkenas/backbone/issues/3592/labels{/name}","comments_url":"https://api.github.com/repos/jashkenas/backbone/issues/3592/comments","events_url":"https://api.github.com/repos/jashkenas/backbone/issues/3592/events","html_url":"https://github.com/jashkenas/backbone/issues/3592","id":72144295,"number":3592,"title":"Catching errors thrown in change event callbacks leaves the `_changing` true and won't trigger any change events after","user":{"login":"2color","id":1992255,"avatar_url":"https://avatars.githubusercontent.com/u/1992255?v=3","gravatar_id":"","url":"https://api.github.com/users/2color","html_url":"https://github.com/2color","followers_url":"https://api.github.com/users/2color/followers","following_url":"https://api.github.com/users/2color/following{/other_user}","gists_url":"https://api.github.com/users/2color/gists{/gist_id}","starred_url":"https://api.github.com/users/2color/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/2color/subscriptions","organizations_url":"https://api.github.com/users/2color/orgs","repos_url":"https://api.github.com/users/2color/repos","events_url":"https://api.github.com/users/2color/events{/privacy}","received_events_url":"https://api.github.com/users/2color/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jashkenas/backbone/labels/invalid","name":"invalid","color":"e6e6e6"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-04-30T12:31:11Z","updated_at":"2015-04-30T20:18:52Z","closed_at":null,"body":"```javascript\r\nvar theModel = new Backbone.Model();\r\n\r\ntheModel.on('change:name', function(model, val) {\r\n    if(val === 'Jesus') {\r\n        throw new Error('The name is taken');\r\n    }\r\n});\r\n\r\ntheModel.on('change', function(model, val) {\r\n    console.log('change', arguments);\r\n});\r\n\r\ntheModel.set('name', 'Default Name'); //Triggers a change event\r\n\r\ntry {\r\n    theModel.set( 'name', 'Jesus' );\r\n} catch (e) {\r\n    console.error(e);\r\n    theModel.set( 'name', 'New Name'); // Won't trigger a `change` event. Only a `change:name` event.\r\n}\r\n```\r\n\r\nThe problem I'm experiencing requires me to manually set `theModel._changing = false;` `theModel._pending = false;`. Otherwise no `change` event will be triggered after."},"comment":{"url":"https://api.github.com/repos/jashkenas/backbone/issues/comments/97954358","html_url":"https://github.com/jashkenas/backbone/issues/3592#issuecomment-97954358","issue_url":"https://api.github.com/repos/jashkenas/backbone/issues/3592","id":97954358,"user":{"login":"jridgewell","id":112982,"avatar_url":"https://avatars.githubusercontent.com/u/112982?v=3","gravatar_id":"","url":"https://api.github.com/users/jridgewell","html_url":"https://github.com/jridgewell","followers_url":"https://api.github.com/users/jridgewell/followers","following_url":"https://api.github.com/users/jridgewell/following{/other_user}","gists_url":"https://api.github.com/users/jridgewell/gists{/gist_id}","starred_url":"https://api.github.com/users/jridgewell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jridgewell/subscriptions","organizations_url":"https://api.github.com/users/jridgewell/orgs","repos_url":"https://api.github.com/users/jridgewell/repos","events_url":"https://api.github.com/users/jridgewell/events{/privacy}","received_events_url":"https://api.github.com/users/jridgewell/received_events","type":"User","site_admin":false},"created_at":"2015-04-30T20:18:52Z","updated_at":"2015-04-30T20:18:52Z","body":"I'm not saying that errors should be trivial, but for an error to prevent library code from functioning correctly seems like a problem."}}