hirezio/observer-spy

`ObserverSpy` swallows errors

shairez opened this issue ยท 1 comments

Describe the bug

When an error is thrown unexpectedly, the error method on the ObserverSpy catches it and basically "hides" it from the user.

And by that making debugging an unexpected error much more difficult.

To Reproduce
Steps to reproduce the behavior:

  1. throw an error in an observable
  2. See no trace of it in the logs

Expected behavior
We should be able to configure the observer spy (on creation or via subscribeSpyTo) to flag whether an error is expected or not.

The default should be that the error is not expected and should be re-thrown so it would be shown in the console.

๐ŸŽ‰ This issue has been resolved in version 2.0.0 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€