Silently skips errors on file upload

This commit is contained in:
Fabio Sinibaldi 2020-02-03 18:39:11 +01:00
parent 1c051bab6f
commit 7becd2f8d9
1 changed files with 3 additions and 3 deletions

View File

@ -52,7 +52,7 @@ public class UploadFilesCall implements Callable<ZenodoDeposition>{
log.debug("Remote file "+f+" is not in requested set. Deleting it.."); log.debug("Remote file "+f+" is not in requested set. Deleting it..");
z.deleteFile(dep, f); z.deleteFile(dep, f);
}catch(Throwable t) { }catch(Throwable t) {
throw new Exception("Unable to delete "+f,t); log.warn("Unable to delete "+f,t);
} }
else { else {
// File present, checking for update // File present, checking for update
@ -66,7 +66,7 @@ public class UploadFilesCall implements Callable<ZenodoDeposition>{
z.uploadFile(dep, found.getName(), downloaded.getF()); z.uploadFile(dep, found.getName(), downloaded.getF());
} }
}catch(Throwable t) { }catch(Throwable t) {
throw new Exception("Unable to update "+f,t); log.warn("Unable to update "+f,t);
}finally { }finally {
if(downloaded!=null) Files.deleteIfExists(downloaded.getF().toPath()); if(downloaded!=null) Files.deleteIfExists(downloaded.getF().toPath());
} }
@ -91,7 +91,7 @@ public class UploadFilesCall implements Callable<ZenodoDeposition>{
z.uploadFile(dep, r.getName(),downloaded.getF()); z.uploadFile(dep, r.getName(),downloaded.getF());
} }
}catch(Throwable t) { }catch(Throwable t) {
throw new Exception("Unable to upload "+r.getName()+".",t); log.warn("Unable to upload "+r.getName()+".",t);
} }
} }
return z.readDeposition(dep.getId()); return z.readDeposition(dep.getId());