Recently published the previous WEBAPI project to the server, the database from SQL Server2008 Express to SQL Server2000, but the paging query when the server throws a "500 error", but do not see the details of the error, according to previous experience to the configuration file customErrors Open still do not see the details, because the project is published on the server, there is no way to debug, and the server is windows20003, the page has no way to debug remotely, write Try...catch ... Catch the error in action and throw still get no details, no error details, no direction to modify the error, and then search the solution on the Internet, found that Webapi error, only throws 500, does not contain the details, The only way to get the details of the error is to throw the httpresponseexception, and the code is as follows:
Try{ ...}Catch(Exception e) {//it must be thrown in Webapi to throw an exception, otherwise it throws a default 500 exception varRESP =NewHttpresponsemessage (httpstatuscode.internalservererror) {Content=Newstringcontent (E.tostring ()), Reasonphrase="Error" }; Throw Newhttpresponseexception (RESP);}
Finally, according to the error details found that the new version of NHibernate does not support SQL Server2000 paged query, and installed a SQL Server2005 error resolution.
Just in writing this record time just think that actually need not so troublesome, can direct the exception detailed content output, and detours ...