有什么区别
try { ... }
catch{ throw }
Run Code Online (Sandbox Code Playgroud)
和
try{ ... }
catch(Exception e) {throw new Exception(e.message) }
Run Code Online (Sandbox Code Playgroud)
无论第二个显示消息?
我有以下代码用于调用uri:
var uri = string.Format("Helpers/ProfileList/Online/?locationId=0&skip=0&take={0}", numProfiles);
HttpResponseMessage response = await client.GetAsync(uri);
response.EnsureSuccessStatusCode();
Run Code Online (Sandbox Code Playgroud)
uri指向一个自定义的web api uri(我可以调试并完成).但是,当调用api中的最后一个return语句时,似乎什么也没发生.它应该去response.EnsureSuccessStatusCode();
线,但事实并非如此.它似乎挂了.