diff --git a/Duplicati/Library/Backend/OneDrive/MicrosoftGraphBackend.cs b/Duplicati/Library/Backend/OneDrive/MicrosoftGraphBackend.cs index 3d20d1e38..28772b4d2 100644 --- a/Duplicati/Library/Backend/OneDrive/MicrosoftGraphBackend.cs +++ b/Duplicati/Library/Backend/OneDrive/MicrosoftGraphBackend.cs @@ -740,8 +740,20 @@ namespace Duplicati.Library.Backend using (var request = new HttpRequestMessage(HttpMethod.Delete, uploadSession.UploadUrl)) using (var response = await this.m_client.SendAsync(request, false, cancelToken).ConfigureAwait(false)) { - // Note that the response body should always be empty in this case. - await this.ParseResponseAsync(response, cancelToken).ConfigureAwait(false); + try + { + // Note that the response body should always be empty in this case. + if (response.StatusCode != HttpStatusCode.NoContent) + await this.ParseResponseAsync(response, cancelToken).ConfigureAwait(false); + } + catch (Exception parseEx) + { + Log.WriteErrorMessage( + LOGTAG, + "MicrosoftGraphUploadSessionCancelError", + parseEx, + "Error canceling upload session after fragment upload failure"); + } } throw new UploadSessionException(createSessionResponse, fragment, fragmentCount, ex);