我有一個RequestDto,它接受一個INT參數如何捕捉ServiceStack RequestBindingException
[Route("/club/thread/{Id}","GET")]
public MyDto{
[Apimember(DataType="int32")]
public int Id{get;set;}
}
當我輸入http://myservice/club/thread/aaa.json
,是拋出一個異常:
[RequestBindingException:無法綁定請求]
ServiceStack.WebHost.Endpoints.RestHandler.GetRequest(IHttpRequest httpReq,IRestPath restPath)538
ServiceStack.WebHost.Endpoints.RestHandler.ProcessRequest(IHttpRequest httpReq,IHttpResponse httpRes,字符串operationName)1023
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()913
System.Web.HttpApplication.ExecuteStep(IExecutionStep一步,布爾& completedSynchronously)+ 165
AppHost.ExceptionHandler不能趕上這個例外,我怎樣才能抓住它?