rsocket-js icon indicating copy to clipboard operation
rsocket-js copied to clipboard

Fix error messages in `onError` and in `onNext`

Open ScavengerSpb opened this issue 3 years ago • 0 comments

State error messages Flowable: Invalid call to onXxx(): onComplete/onError was already called.' / Flowable: Invalid call to onXxx(): onSubscribe has not been called.' are printed correctly now in onError and onNext methods.

Motivation:

Previously, state error message Flowable: Invalid call to onXxx(): onSubscribe has not been called.' was printed always regardles of the actual state of FlowableSubscriber. Even on attempt to operate on FlowableSubscriber when flow was completed already (either by prior call to onError or onComplete method).

Note: State error message in onComplete method works correctly already.

Modifications:

Checks for this._active are replaced with this._started.

Result:

State error message Flowable: Invalid call to onXxx(): onComplete/onError was already called.' is printed on attempt to operate on FlowableSubscriber when flow is completed already.

ScavengerSpb avatar Jan 05 '22 20:01 ScavengerSpb