Change .NET HttpCommandExecutor to throw more expressive exception
@@ -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);
