Skip to content

Commit 8318c52

Browse files
author
Caitlin Bales (MSFT)
committed
Throw errors up the chain instead of logging
1 parent df7bc3b commit 8318c52

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/com/microsoft/graph/requests/extensions/ChunkedUploadRequest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public ChunkedUploadRequest(final String requestUrl,
9292
/**
9393
* Upload a chunk with tries.
9494
*
95-
* @param responseHandler The handler handle HTTP response.
95+
* @param responseHandler The handler to handle the HTTP response.
9696
* @param <UploadType> The upload item type.
9797
* @return The upload result.
9898
*/
@@ -102,7 +102,7 @@ public <UploadType> ChunkedUploadResult upload(
102102
try {
103103
Thread.sleep(RETRY_DELAY * this.retryCount * this.retryCount);
104104
} catch (final InterruptedException e) {
105-
this.baseRequest.getClient().getLogger().logError("Exception while waiting to retry file upload.", e);
105+
throw new ClientException("Exception while waiting to retry file upload.", e);
106106
}
107107

108108
ChunkedUploadResult result = null;
@@ -113,7 +113,7 @@ public <UploadType> ChunkedUploadResult upload(
113113
.getHttpProvider()
114114
.send(baseRequest, ChunkedUploadResult.class, this.data, responseHandler);
115115
} catch (final ClientException e) {
116-
this.baseRequest.getClient().getLogger().logDebug("Request failed with error, retry if necessary.\r\n" + e);
116+
throw new ClientException("Request failed with error, retry if necessary.", e);
117117
}
118118

119119
if (result != null && result.chunkCompleted()) {

0 commit comments

Comments
 (0)