We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2877cce commit 47ebeb5Copy full SHA for 47ebeb5
dotnet/src/webdriver/Response.cs
@@ -221,9 +221,14 @@ public string ToJson()
221
/// </summary>
222
/// <exception cref="WebDriverException">If <see cref="Value"/> is <see langword="null"/>.</exception>
223
[MemberNotNull(nameof(Value))]
224
- internal object EnsureValueIsNotNull(string? errorMessage = null)
+ internal Response EnsureValueIsNotNull(string commandName)
225
{
226
- return Value ?? throw new WebDriverException(errorMessage ?? "Expected not-null response");
+ if (Value is null)
227
+ {
228
+ throw new WebDriverException($"{commandName} command returned a successful result, but contained no data");
229
+ }
230
+
231
+ return this;
232
}
233
234
/// <summary>
0 commit comments