Search in sources :

Example 1 with BadUrlException

use of org.odk.collect.android.exception.BadUrlException in project collect by opendatakit.

the class InstanceGoogleSheetsUploader method setUpSpreadsheet.

private void setUpSpreadsheet(String urlString) throws UploadException, GoogleJsonResponseException {
    if (spreadsheet == null || spreadsheet.getSpreadsheetUrl() == null || !urlString.equals(spreadsheet.getSpreadsheetUrl())) {
        try {
            spreadsheet = sheetsHelper.getSpreadsheet(UrlUtils.getSpreadsheetID(urlString));
            spreadsheet.setSpreadsheetUrl(urlString);
        } catch (GoogleJsonResponseException e) {
            Timber.i(e);
            throw e;
        } catch (IOException | BadUrlException e) {
            Timber.i(e);
            throw new UploadException(e);
        }
    }
}
Also used : GoogleJsonResponseException(com.google.api.client.googleapis.json.GoogleJsonResponseException) UploadException(org.odk.collect.android.upload.UploadException) IOException(java.io.IOException) BadUrlException(org.odk.collect.android.exception.BadUrlException)

Aggregations

GoogleJsonResponseException (com.google.api.client.googleapis.json.GoogleJsonResponseException)1 IOException (java.io.IOException)1 BadUrlException (org.odk.collect.android.exception.BadUrlException)1 UploadException (org.odk.collect.android.upload.UploadException)1