๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๋นˆ ๊ตฌ๋ฉ ์ฑ„์šฐ๊ธฐ

[RxJava] io.reactivex.exceptions.OnErrorNotImplementedException

์ด์Šˆ๋ฅผ ํ™•์ธํ–ˆ๋‹ค. 

 

Fatal Exception: 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 
 

ReactiveX/RxJava

RxJava – Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM. - ReactiveX/RxJava

github.com

OnErrorNotImplementedException
This indicates that an Observable tried to call its observer’s onError() method, but that no such method existed. You can eliminate this by either fixing the Observable so that it no longer reaches an error condition, by implementing an onError handler in the observer, or by intercepting the onError notification before it reaches the observer by using one of the operators described elsewhere on this page.

Observable์ด observer์˜ onError() ๋ฉ”์†Œ๋“œ๋ฅผ ํ˜ธ์ถœํ•˜๋ ค๊ณ  ํ–ˆ์œผ๋‚˜ ์ด ๋ฉ”์†Œ๋“œ๊ฐ€ ์กด์žฌํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. 1) ์—๋Ÿฌ ์กฐ๊ฑด์œผ๋กœ ์ง„์ž…ํ•˜์ง€ ์•Š๋„๋ก Observable์„ ์ˆ˜์ •ํ•˜๊ฑฐ๋‚˜, 2) observer์— onError ํ•ธ๋“ค๋Ÿฌ๋ฅผ ๊ตฌํ˜„ํ•˜๊ฑฐ๋‚˜, 3) observer์— ๋„๋‹ฌํ•˜๊ธฐ ์ „์— ๋‹ค๋ฅธ ์—ฐ์‚ฐ์ž๋ฅผ ์‚ฌ์šฉํ•ด onError ์•Œ๋ฆผ์„ ๊ฐ€๋กœ์ฑ„๋Š” ๋ฐฉ์‹์œผ๋กœ ํ•ด๋‹น ์ด์Šˆ๋ฅผ ์ œ๊ฑฐํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.