1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

RxでUndeliverableExceptionが発生する

Last updated at Posted at 2019-06-09

はじめに

Observableで返して、subscribeする際にUndeliverableExceptionなるものが発生していました。
これでググるとDispose後にonErrorが呼び出されると発生する、という記事は見かけたのですが、Disposeは画面が終了するときにしか呼んでいないため今回は当てはまらない…なぜだ…となりました。
とりあえず解消は出来たので、その備忘録として残しておきます。

結局理由はなんだったのか

実装を一から見直してみたところ、メインスレッドで動くべきところでメインスレッドが指定されてない…というチョンボを見つけました。
ここ関係ないよな…と思いつつobserveOnでメインスレッド指定してみたら解消されました。

おわりに

結局UndeliverableExceptionがスレッド指定に因るものだったのか根本解析は出来ていないのですが、発生しなくなってちゃんと動いてくれているようなので「とりあえず」解決。
こういった何が悪いのかわからないときは実装を見直す必要がやっぱりありますね。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?