compositeDisposable.add(APIClient.getOpenEventAPI().getDiscountCodes()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(discountList -> {
Timber.i("Downloaded Discount Codes");
realmRepo.saveDiscountCodes(discountList).subscribe();
discountCodesDownloadResponse.setValue(true);
}, throwable -> {
Timber.i("Discount Codes download failed");
discountCodesDownloadResponse.setValue(false);
}));
} catch (Exception e) {
Timber.e(e);
}```
this is taken from discountVM similar issue can be found in some other VM's too
Actual Behaviour
Unnecessary try and catch blocks are present
Expected Behaviour
They are not of any use, should be removed
Would you like to work on the issue?
Yes
Example