truetime-android icon indicating copy to clipboard operation
truetime-android copied to clipboard

Library throw exception in rx flow

Open Vaek opened this issue 6 years ago • 4 comments

Actually we log exceptions from library. What fix you suggest?

java.io.IOException: Operation not permitted
    at java.net.PlainDatagramSocketImpl.send(PlainDatagramSocketImpl.java)
    at java.net.DatagramSocket.send(DatagramSocket.java:696)
    at com.instacart.library.truetime.SntpClient.requestTime(SntpClient.java:116)
    at com.instacart.library.truetime.TrueTime.requestTime(TrueTime.java:133)
    at com.instacart.library.truetime.TrueTimeRx$4$1$2.subscribe(TrueTimeRx.java:211)
    at io.reactivex.internal.operators.flowable.FlowableCreate.subscribeActual(FlowableCreate.java:72)
    at io.reactivex.Flowable.subscribe(Flowable.java:14409)
    at io.reactivex.Flowable.subscribe(Flowable.java:14356)
    at io.reactivex.internal.operators.flowable.FlowableSubscribeOn$SubscribeOnSubscriber.run(FlowableSubscribeOn.java:82)
    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:237)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:272)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:761)

Vaek avatar Mar 08 '19 12:03 Vaek

Use https://github.com/instacart/truetime-android/issues/101#issuecomment-461219933

jemshit avatar Mar 14 '19 09:03 jemshit

Thanks but it is not solution. We already have set global rx error handler. Error should be catched by subscribed observer, if it would be thrown in init flow, but these errors are thrown in library scheduled work. What about add subscription for these scheduled work? In global error handler we are not able to recognise this IOException from other errors.

Vaek avatar Mar 14 '19 10:03 Vaek

I know it's been a while but I've posted my finding in here: https://github.com/instacart/truetime-android/issues/119#issuecomment-510043102 . Maybe this will help you somehow

LosDanieloss avatar Jul 10 '19 12:07 LosDanieloss

SDK Sdk

DidUNooono avatar Dec 25 '22 22:12 DidUNooono