From 0fc29bc0f863fd1a90e50e0cad64599c0cf82492 Mon Sep 17 00:00:00 2001 From: Yang Hu Date: Wed, 17 May 2017 13:49:26 -0700 Subject: [PATCH] Handle the UploadFile conflict exception correctly --- Box.V2/Extensions/BoxResponseExtensions.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Box.V2/Extensions/BoxResponseExtensions.cs b/Box.V2/Extensions/BoxResponseExtensions.cs index 601b4ab64..875a08c3a 100644 --- a/Box.V2/Extensions/BoxResponseExtensions.cs +++ b/Box.V2/Extensions/BoxResponseExtensions.cs @@ -58,11 +58,12 @@ public static IBoxResponse ParseResults(this IBoxResponse response, IBo switch (response.StatusCode) { case System.Net.HttpStatusCode.Conflict: - if (response is IBoxResponse) + if (response is IBoxResponse || response is IBoxResponse>) { BoxPreflightCheckConflictError err = converter.Parse>(response.ContentString); exToThrow = new BoxPreflightCheckConflictException(response.ContentString, err) { StatusCode = response.StatusCode, ResponseHeaders = response.Headers }; - } else + } + else { BoxConflictError error = converter.Parse>(response.ContentString); exToThrow = new BoxConflictException(response.ContentString, error) { StatusCode = response.StatusCode, ResponseHeaders = response.Headers };