putting Error objects in the store makes it non-serializable (right?)
Opened this issue · 2 comments
I'm fairly certain that doing this will break people's time travel debugging. This probably isn't a serious issue, but I think it's nice to not do that by default.
@hallettj specifically requested this feature so I should leave in a flag or something that allows you to continue to use Error objects in your store.
This will technically be a breaking change if it goes ahead so it can be in 5.0.0
- verify this actually breaks time travel debugging
- fix actionTypes.js
- fix selectors.js
- check the changes in issue #15 to see how to make this behaviour optional. I think it will just involve a conditional to not use toJS() if the error is an Error object
should an error be more of a property/object on a record? kinda like ember-data's model.errors
?
Unless we added a lot more logic, I don't think errors should live on the model. There's no code in here to determine the difference between a network error, a serverside 500 fatal error, or a validation error on save.
Of course, feel free to add a pull request ;)