airbnb / RxGroups

Easily group RxJava Observables together and tie them to your Android Activity lifecycle
Apache License 2.0
693 stars 44 forks source link

OnErrorNotImplemented exception #32

Open felipecsl opened 7 years ago

felipecsl commented 7 years ago

If an exception is thrown from resubscriptionTag(), then RxGroups will throw with OnErrorNotImplementedException. We should probably implement onError and provide a more meaningful message. Here's the current stacktrace:

java.lang.IllegalStateException: Exception thrown on Scheduler.Worker thread. Add `onError` handling.
   at rx.android.schedulers.LooperScheduler$ScheduledAction.run(LooperScheduler.java:112)
   at android.os.Handler.handleCallback(Handler.java:739)
   at android.os.Handler.dispatchMessage(Handler.java:95)
   at android.os.Looper.loop(Looper.java:135)
   at android.app.ActivityThread.main(ActivityThread.java:5254)
   at java.lang.reflect.Method.invoke(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:372)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Caused by: rx.exceptions.OnErrorNotImplementedException: Exception thrown from 'resubscriptionTag()'
   at rx.internal.util.InternalObservableUtils$ErrorNotImplementedAction.call(InternalObservableUtils.java:386)
   at rx.internal.util.InternalObservableUtils$ErrorNotImplementedAction.call(InternalObservableUtils.java:383)
   at rx.internal.util.ActionSubscriber.onError(ActionSubscriber.java:44)
   at rx.observers.SafeSubscriber._onError(SafeSubscriber.java:153)
   at rx.observers.SafeSubscriber.onError(SafeSubscriber.java:115)
   at rx.internal.operators.OnSubscribeFilter$FilterSubscriber.onError(OnSubscribeFilter.java:90)
   at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.checkTerminated(OperatorObserveOn.java:273)
   at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.call(OperatorObserveOn.java:216)
   at rx.android.schedulers.LooperScheduler$ScheduledAction.run(LooperScheduler.java:107)
   at android.os.Handler.handleCallback(Handler.java:739) 
   at android.os.Handler.dispatchMessage(Handler.java:95) 
   at android.os.Looper.loop(Looper.java:135) 
   at android.app.ActivityThread.main(ActivityThread.java:5254) 
   at java.lang.reflect.Method.invoke(Native Method) 
   at java.lang.reflect.Method.invoke(Method.java:372) 
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) 
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) 
Caused by: java.lang.RuntimeException: Exception thrown from 'resubscriptionTag()'
   at com.airbnb.rxgroups.LifecycleResubscription$4.call(LifecycleResubscription.java:109)
   at com.airbnb.rxgroups.LifecycleResubscription$4.call(LifecycleResubscription.java:98)
   at rx.internal.util.ScalarSynchronousObservable$3.call(ScalarSynchronousObservable.java:231)
   at rx.internal.util.ScalarSynchronousObservable$3.call(ScalarSynchronousObservable.java:228)
   at rx.Observable.unsafeSubscribe(Observable.java:10142)
   at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:248)
   at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:148)
   at rx.internal.operators.OnSubscribeMap$MapSubscriber.onNext(OnSubscribeMap.java:77)
   at rx.internal.operators.OnSubscribeFilter$FilterSubscriber.onNext(OnSubscribeFilter.java:76)
   at rx.internal.operators.OperatorMerge$MergeSubscriber.emitScalar(OperatorMerge.java:395)
   at rx.internal.operators.OperatorMerge$MergeSubscriber.tryEmit(OperatorMerge.java:355)
   at rx.internal.operators.OperatorMerge$InnerSubscriber.onNext(OperatorMerge.java:846)
   at rx.internal.operators.OnSubscribeFromIterable$IterableProducer.slowPath(OnSubscribeFromIterable.java:117)
   at rx.internal.operators.OnSubscribeFromIterable$IterableProducer.request(OnSubscribeFromIterable.java:89)
   at rx.Subscriber.setProducer(Subscriber.java:211)
   at rx.internal.operators.OnSubscribeFromIterable.call(OnSubscribeFromIterable.java:63)
   at rx.internal.operators.OnSubscribeFromIterable.call(OnSubscribeFromIterable.java:34)
   at rx.Observable.unsafeSubscribe(Observable.java:10142)
   at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:248)
   at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:148)
   at rx.internal.operators.OnSubscribeMap$MapSubscriber.onNext(OnSubscribeMap.java:77)
   at rx.internal.util.ScalarSynchronousObservable$ScalarAsyncProducer.call(ScalarSynchronousObservable.java:200)
   at rx.internal.util.ScalarSynchronousObservable$2$1.call(ScalarSynchronousObservable.java:114)
   at rx.internal.schedulers.CachedThreadScheduler$EventLoopWorker$1.call(CachedThreadScheduler.java:230)
   at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
 at java.util.concurrent.FutureTask.run(FutureTask.j