Skip to content

Commit 9d04947

Browse files
committed
Continue uploading the files to OwnCloud if the folder creation fails
OwnCloud seems to report an error, if we try to create a folder that already exists. We don't care, so we just go ahead uploading the files instead of throwing an exception.
1 parent e344246 commit 9d04947

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

app/src/main/java/org/gnucash/android/export/ExportAsyncTask.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,10 @@ private void moveExportToOwnCloud() throws Exporter.ExporterException {
387387
if (mOC_dir.length() != 0) {
388388
RemoteOperationResult dirResult = new CreateRemoteFolderOperation(
389389
mOC_dir, true).execute(mClient);
390-
if (!dirResult.isSuccess())
391-
throw new Exporter.ExporterException(mExportParams, dirResult.getLogMessage());
390+
if (!dirResult.isSuccess()) {
391+
Log.w(TAG, "Error creating folder (it may happen if it already exists): "
392+
+ dirResult.getLogMessage());
393+
}
392394
}
393395
for (String exportedFilePath : mExportedFiles) {
394396
String remotePath = mOC_dir + FileUtils.PATH_SEPARATOR + stripPathPart(exportedFilePath);

0 commit comments

Comments
 (0)