Description
Currently, if you have an error that occurs within a selector, useSelector will catch this and rethrow it, including the stack for latestSubscriptionCallbackError
, which is useful when there is a genuine error in latestSubscriptionCallbackError. In the cases where the error has simply occurred within the selector due to a programming or data error, all information about where that error happened is lost, which can be quite infuriating for complex selectors.
All I'm proposing is to print the original error's err.stack
, rather than just err.message
. This will obviously increase the error size substantially but given the stack is already printed for latestSubscriptionCallbackError
, it seems like a reasonable change.
Happy to put together a PR for this, as it's only a one line change + tests from what I can see.