밍쯔와 안작고 안귀여운 에러들🖤

OnErrorNotImplementedException: The exception was not handled due to missing onError handler in the subscribe() method call,,,였던것,,,, 본문

Develop/Android | iOS

OnErrorNotImplementedException: The exception was not handled due to missing onError handler in the subscribe() method call,,,였던것,,,,

밍쯔 2022. 7. 14. 18:03

문제 상황 

- 회원 탈퇴 후 Login액티비티로 전환하는 과정에서 해당 에러와 함께 전환 안됨.

- 탈퇴 api는 작동됨. 이후 전환이 안되는 것 같음.

 

해결,,;;

- 탈퇴 후 설정 페이지가 닫히면서 실행되는 onPause()에 있던 api가 실행된 후 문제가 있었다.

- 문제는 404 에러였고, flag 설정해주고 탈퇴 하는 경우와 아닌 경우 onPause() 분리해주니 해결!_!

 

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.nwrn.pfdy.dev, PID: 10339
    io.reactivex.exceptions.OnErrorNotImplementedException: The exception was not handled due to missing onError handler in the subscribe() method call. Further reading: https://github.com/ReactiveX/RxJava/wiki/Error-Handling | retrofit2.adapter.rxjava2.HttpException: HTTP 404 
        at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:704)
        at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:701)
        at io.reactivex.internal.observers.ConsumerSingleObserver.onError(ConsumerSingleObserver.java:46)
        at io.reactivex.internal.operators.single.SingleObserveOn$ObserveOnSingleObserver.run(SingleObserveOn.java:79)
        at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:124)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
     Caused by: retrofit2.adapter.rxjava2.HttpException: HTTP 404 
        at retrofit2.adapter.rxjava2.BodyObservable$BodyObserver.onNext(BodyObservable.java:57)
        at retrofit2.adapter.rxjava2.BodyObservable$BodyObserver.onNext(BodyObservable.java:38)
        at retrofit2.adapter.rxjava2.CallExecuteObservable.subscribeActual(CallExecuteObservable.java:48)
        at io.reactivex.Observable.subscribe(Observable.java:12285)
        at retrofit2.adapter.rxjava2.BodyObservable.subscribeActual(BodyObservable.java:35)
        at io.reactivex.Observable.subscribe(Observable.java:12285)
        at io.reactivex.internal.operators.observable.ObservableSingleSingle.subscribeActual(ObservableSingleSingle.java:35)
        at io.reactivex.Single.subscribe(Single.java:3666)
        at io.reactivex.internal.operators.single.SingleSubscribeOn$SubscribeOnObserver.run(SingleSubscribeOn.java:89)
        at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578)
        at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
        at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)

 

[참고]

https://week-year.tistory.com/181

 

[안드로이드] Retrofit2에서 response.code() == 404 일 때, response.body() == null 나오는 경우

결론 긴 글 읽기 귀찮으신 분들을 위해 먼저 결론부터 말씀드리겠습니다. response.code() Integer 값이 200 미만이거나 300이상 혹은 204나 205일 경우에는 response.body()는 null이 되어서 백엔드 서버에서 res

week-year.tistory.com