We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This can be implemented using:
final class MapErrorEventStream[A](val parent: Observable[A], f: PartialFunction[Throwable, Throwable]) extends EventStream[A] with SingleParentObservable[A, A] with InternalNextErrorObserver[A] { protected[airstream] val topoRank: Int = parent.topoRank + 1 protected[airstream] def onNext(nextValue: A, transaction: Transaction): Unit = fireValue(nextValue, transaction) protected[airstream] def onError(nextError: Throwable, transaction: Transaction): Unit = try fireError(f.applyOrElse(nextError, identity[Throwable]), transaction) catch { case NonFatal(t) => fireError(AirstreamError.ObserverErrorHandlingError(t, nextError), transaction) } }
This is useful when using Ajax streams with services that can return specific errors.
The text was updated successfully, but these errors were encountered:
mapError would need to accept a total function. I guess we can call this collectError.
mapError
collectError
Sorry, something went wrong.
+1 on total function (since it would support both mapError and collectError).
I meant both combinators can be provided.
def mapError(f: Throwable => Throwable) def collectError(pf: PartialFunction[Throwable, Throwable]) = mapError(pf.applyOrElse(_, identity[Throwable]))
No branches or pull requests
This can be implemented using:
This is useful when using Ajax streams with services that can return specific errors.
The text was updated successfully, but these errors were encountered: