Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Client.Test.Integration/WriteTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ public void WritePartialBatchBehaviorByWriteApi(bool useV2Api, bool expectStruct
Assert.That(pwe.LineErrors, Is.Not.Empty);
Assert.That(ae.Message,
Does.Contain("partial write of line protocol occurred")
.Or.Contain("parsing failed for write_lp endpoint"));
.Or.Contain("parsing failed for write_lp endpoint")
.Or.Contain("line protocol parsing error"));
}
else
{
Expand Down
3 changes: 2 additions & 1 deletion Client/Internal/RestClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
}

if (!string.IsNullOrEmpty(contentType) &&
!contentType.StartsWith("application/json", StringComparison.OrdinalIgnoreCase))

Check warning on line 130 in Client/Internal/RestClient.cs

View workflow job for this annotation

GitHub Actions / CodeQL-Build

Dereference of a possibly null reference.
{
return ParsedErrorMessage.Empty;
}
Expand Down Expand Up @@ -167,7 +167,7 @@

private static ParsedErrorMessage? ParsePartialWrite(string? topLevelError, JsonElement? data)
{
if (string.IsNullOrEmpty(topLevelError) || !IsPartialWriteError(topLevelError))

Check warning on line 170 in Client/Internal/RestClient.cs

View workflow job for this annotation

GitHub Actions / CodeQL-Build

Possible null reference argument for parameter 'topLevelError' in 'bool RestClient.IsPartialWriteError(string topLevelError)'.
{
return null;
}
Expand Down Expand Up @@ -248,7 +248,8 @@
private static bool IsPartialWriteError(string topLevelError)
{
return topLevelError.IndexOf("partial write of line protocol occurred", StringComparison.OrdinalIgnoreCase) >= 0 ||
topLevelError.IndexOf("parsing failed for write_lp endpoint", StringComparison.OrdinalIgnoreCase) >= 0;
topLevelError.IndexOf("parsing failed for write_lp endpoint", StringComparison.OrdinalIgnoreCase) >= 0 ||
topLevelError.IndexOf("line protocol parsing error", StringComparison.OrdinalIgnoreCase) >= 0;
}

private static string? CombineMessages(string? topLevelError, string? dataMessage)
Expand Down
Loading