You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 justerr.message
. This will obviously increase the error size substantially but given the stack is already printed forlatestSubscriptionCallbackError
, 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.
The text was updated successfully, but these errors were encountered: