Failure in onComplete method of AbstractFsBlobContainer#readBlob should trigger onFailure

This commit is contained in:
Igor Motov 2013-11-11 20:57:50 -05:00
parent ab52ab48dd
commit f9b43a9efa
1 changed files with 8 additions and 4 deletions

View File

@ -88,13 +88,17 @@ public abstract class AbstractFsBlobContainer extends AbstractBlobContainer {
while ((bytesRead = is.read(buffer)) != -1) { while ((bytesRead = is.read(buffer)) != -1) {
listener.onPartial(buffer, 0, bytesRead); listener.onPartial(buffer, 0, bytesRead);
} }
} catch (Throwable e) { } catch (Throwable t) {
IOUtils.closeWhileHandlingException(is); IOUtils.closeWhileHandlingException(is);
listener.onFailure(e); listener.onFailure(t);
return; return;
} }
try {
IOUtils.closeWhileHandlingException(is); IOUtils.closeWhileHandlingException(is);
listener.onCompleted(); listener.onCompleted();
} catch (Throwable t) {
listener.onFailure(t);
}
} }
}); });
} }