Skip to content

Commit 5724af5

Browse files
committed
[dotnet] Improve error message further
1 parent 8156127 commit 5724af5

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

dotnet/src/webdriver/DevTools/v135/V135Network.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public override async Task ContinueRequestWithResponse(HttpRequestData requestDa
192192
var commandSettings = new FulfillRequestCommandSettings()
193193
{
194194
RequestId = requestData.RequestId,
195-
ResponseCode = responseData.StatusCode!.Value,
195+
ResponseCode = responseData.StatusCode ?? throw new ArgumentException("Response data status code cannot be missing", nameof(responseData)),
196196
};
197197

198198
if (responseData.Headers.Count > 0 || responseData.CookieHeaders.Count > 0)

dotnet/src/webdriver/DevTools/v136/V136Network.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public override async Task ContinueRequestWithResponse(HttpRequestData requestDa
192192
var commandSettings = new FulfillRequestCommandSettings()
193193
{
194194
RequestId = requestData.RequestId,
195-
ResponseCode = responseData.StatusCode!.Value,
195+
ResponseCode = responseData.StatusCode ?? throw new ArgumentException("Response data status code cannot be missing", nameof(responseData)),
196196
};
197197

198198
if (responseData.Headers.Count > 0 || responseData.CookieHeaders.Count > 0)

dotnet/src/webdriver/DevTools/v137/V137Network.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public override async Task ContinueRequestWithResponse(HttpRequestData requestDa
192192
var commandSettings = new FulfillRequestCommandSettings()
193193
{
194194
RequestId = requestData.RequestId,
195-
ResponseCode = responseData.StatusCode!.Value,
195+
ResponseCode = responseData.StatusCode ?? throw new ArgumentException("Response data status code cannot be missing", nameof(responseData)),
196196
};
197197

198198
if (responseData.Headers.Count > 0 || responseData.CookieHeaders.Count > 0)

0 commit comments

Comments
 (0)