fossasia / open-event-droidgen

Open Event Android App Generator https://github.com/fossasia/open-event-android/raw/apk/sample-apk-fossasia17-development.apk
GNU General Public License v3.0
2.06k stars 828 forks source link

removing unnecessary try and catch blocks from VM's #2440

Closed simarsingh24 closed 6 years ago

simarsingh24 commented 6 years ago

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


            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