Skip to content

Commit 13187be

Browse files
committed
Restore using nativeResponseHandler in GET uploadSession to handle errors
1 parent c411888 commit 13187be

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/com/microsoft/graph/core/requests/upload/UploadSessionRequestBuilder.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ public UploadSessionRequestBuilder(@Nonnull String sessionUrl,
4747
@Nonnull
4848
public IUploadSession get() {
4949
RequestInformation requestInformation = toGetRequestInformation();
50-
return requestAdapter.send(requestInformation, null, UploadSession::createFromDiscriminatorValue);
50+
NativeResponseHandler nativeResponseHandler = new NativeResponseHandler();
51+
requestInformation.setResponseHandler(nativeResponseHandler);
52+
requestAdapter.sendPrimitive(requestInformation, null, InputStream.class);
53+
UploadResult<T> result = responseHandler.handleResponse((Response) nativeResponseHandler.getValue(), factory);
54+
return result.uploadSession;
5155
}
5256
private RequestInformation toGetRequestInformation() {
5357
RequestInformation requestInformation = new RequestInformation();

0 commit comments

Comments
 (0)