Search in sources :

Example 1 with PullConversionException

use of org.eyeseetea.malariacare.domain.exception.PullConversionException in project pictureapp by EyeSeeTea.

the class PullController method convertMetaData.

private void convertMetaData(final Callback callback) {
    if (cancelPull) {
        callback.onCancel();
        return;
    }
    callback.onStep(PullStep.CONVERT_METADATA);
    Log.d(TAG, "Converting organisationUnits...");
    try {
        List<OrganisationUnitExtended> assignedOrganisationsUnits = OrganisationUnitExtended.getExtendedList((SdkQueries.getAssignedOrganisationUnits()));
        for (OrganisationUnitExtended assignedOrganisationsUnit : assignedOrganisationsUnits) {
            assignedOrganisationsUnit.accept(mConverter);
        }
        OrgUnitToOptionConverter.convert();
        mPullControllerStrategy.convertMetadata(mConverter);
    } catch (NullPointerException ex) {
        callback.onError(new PullConversionException(ex));
    }
}
Also used : PullConversionException(org.eyeseetea.malariacare.domain.exception.PullConversionException) OrganisationUnitExtended(org.eyeseetea.malariacare.data.sync.importer.models.OrganisationUnitExtended)

Aggregations

OrganisationUnitExtended (org.eyeseetea.malariacare.data.sync.importer.models.OrganisationUnitExtended)1 PullConversionException (org.eyeseetea.malariacare.domain.exception.PullConversionException)1