Skip to content

more info on liveliness errors#1147

Merged
xaviergonz merged 10 commits intomasterfrom
enhance-liveliness-error-info
Jan 25, 2019
Merged

more info on liveliness errors#1147
xaviergonz merged 10 commits intomasterfrom
enhance-liveliness-error-info

Conversation

@xaviergonz
Copy link
Copy Markdown
Contributor

@xaviergonz xaviergonz commented Jan 23, 2019

Fixes #1142

Gives additional info on liveliness errors:

  • the path that the node used to have when it was last seen alive
  • the subpath being accessed/written to (if any)
  • the action name and path the error happened inside (if any)

Examples

const todo = root.todo
root.todo = undefined // todo becomes dead

todo.fn()
"You are trying to read or write to an object that is no longer part of a state tree.
(Object type: 'Todo', Path upon death: '/todo', Subpath: '', Action: '/todo.fn()').
Either detach nodes first, or don't use objects after removing / replacing them in the tree."

todo.title
"You are trying to read or write to an object that is no longer part of a state tree.
(Object type: 'Todo', Path upon death: '/todo', Subpath: 'title', Action: '').
Either detach nodes first, or don't use objects after removing / replacing them in the tree."

@xaviergonz xaviergonz merged commit 80a5529 into master Jan 25, 2019
@xaviergonz xaviergonz deleted the enhance-liveliness-error-info branch February 2, 2019 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Possible enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant