Skip to content

Commit

Permalink
Change .NET HttpCommandExecutor to throw more expressive exception
Browse files Browse the repository at this point in the history
  • Loading branch information
jimevans committed Dec 12, 2018
1 parent ca377ca commit 06047fc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dotnet/src/webdriver/Remote/HttpCommandExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,12 @@ public virtual Response Execute(Command commandToExecute)
}

CommandInfo info = this.commandInfoRepository.GetCommandInfo(commandToExecute.Name);
HttpRequestInfo requestInfo = new HttpRequestInfo(this.remoteServerUri, commandToExecute, info);
if (info == null)
{
throw new NotImplementedException(string.Format("The command you are attempting to execute, {0}, does not exist in the protocol dialect used by the remote end.", commandToExecute.Name));
}

HttpRequestInfo requestInfo = new HttpRequestInfo(this.remoteServerUri, commandToExecute, info);
HttpResponseInfo responseInfo = this.MakeHttpRequest(requestInfo);

Response toReturn = this.CreateResponse(responseInfo);
Expand Down

0 comments on commit 06047fc

Please sign in to comment.