Skip to content

Commit

Permalink
Add logs to show potential errors (#429)
Browse files Browse the repository at this point in the history
In an edge-case scenarios it is possible that the library will hang. Added error logs for this situations.
  • Loading branch information
bleeding182 authored and dariuszseweryn committed Jun 13, 2018
1 parent 9008978 commit e043356
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ public final Observable<T> run(final QueueReleaseInterface queueReleaseInterface
return Observable.create(
new ObservableOnSubscribe<T>() {
@Override
public void subscribe(ObservableEmitter<T> emitter) throws Exception {
public void subscribe(ObservableEmitter<T> emitter) {
try {
protectedRun(emitter, queueReleaseInterface);
} catch (DeadObjectException deadObjectException) {
emitter.tryOnError(provideException(deadObjectException));
RxBleLog.e(deadObjectException, "QueueOperation terminated with a DeadObjectException");
} catch (Throwable throwable) {
emitter.tryOnError(throwable);
RxBleLog.e(throwable, "QueueOperation terminated with an unexpected exception");
}
}
}
Expand Down

0 comments on commit e043356

Please sign in to comment.