Skip to content

Commit

Permalink
Merge pull request #335 from box/conflict-exp
Browse files Browse the repository at this point in the history
Handle the UploadFile conflict exception correctly
  • Loading branch information
coolboy authored May 17, 2017
2 parents d545d18 + 0fc29bc commit ef473d0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Box.V2/Extensions/BoxResponseExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,12 @@ public static IBoxResponse<T> ParseResults<T>(this IBoxResponse<T> response, IBo
switch (response.StatusCode)
{
case System.Net.HttpStatusCode.Conflict:
if (response is IBoxResponse<BoxPreflightCheck>)
if (response is IBoxResponse<BoxPreflightCheck> || response is IBoxResponse<BoxCollection<BoxFile>>)
{
BoxPreflightCheckConflictError<BoxFile> err = converter.Parse<BoxPreflightCheckConflictError<BoxFile>>(response.ContentString);
exToThrow = new BoxPreflightCheckConflictException<BoxFile>(response.ContentString, err) { StatusCode = response.StatusCode, ResponseHeaders = response.Headers };
} else
}
else
{
BoxConflictError<T> error = converter.Parse<BoxConflictError<T>>(response.ContentString);
exToThrow = new BoxConflictException<T>(response.ContentString, error) { StatusCode = response.StatusCode, ResponseHeaders = response.Headers };
Expand Down

0 comments on commit ef473d0

Please sign in to comment.