Skip to content

Commit

Permalink
Merge pull request #268 from DiscoPYF/fixErrorMessagePatchResponse
Browse files Browse the repository at this point in the history
Add ErrorMessage property in PatchDocumentsResponse.
  • Loading branch information
DiscoPYF authored Jul 13, 2020
2 parents 92d6cce + f0dd537 commit 3bae94b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
11 changes: 6 additions & 5 deletions arangodb-net-standard.Test/DocumentApi/DocumentApiClientTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -725,15 +725,16 @@ public async Task PatchDocumentsAsync_ShouldSucceed()
}

[Fact]
public async Task PatchDocumentsAsync_ShouldRecordError_WhenDocumentDoesNotExist()
public async Task PatchDocumentsAsync_ShouldReturnError_WhenDocumentDoesNotExist()
{
var response = await _docClient.PatchDocumentsAsync<object, PatchDocumentsMockModel>(_testCollection,
new[] {
new { _key = "bogusDocument", value = 4 }
}, null);
var response = await _docClient.PatchDocumentsAsync<object, PatchDocumentsMockModel>(
_testCollection,
new[] { new { _key = "bogusDocument", value = 4 } },
null);

Assert.True(response[0].Error);
Assert.Equal(1202, response[0].ErrorNum); // ARANGO_DOCUMENT_NOT_FOUND
Assert.NotNull(response[0].ErrorMessage);
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ public class PatchDocumentsResponse<U> : DocumentBase

public bool Error { get; set; }

/// <summary>
/// Error message.
/// </summary>
public string ErrorMessage { get; set; }

public int ErrorNum { get; set; }
}
}

0 comments on commit 3bae94b

Please sign in to comment.