开发者

Exception wrapping and HTML pages

We have a sharepoint 2007 project at work. The exception handling policy is to log to the Sharepoint logs.

In this case, would the best approach be to call that method and then rethrow the exception higher up? Except if I rethrow it to be caught higher up, there is no other exception handling code so what would happen in this case?

Also, if you are going to display a more friendly error to the user (which uses information in the exception object), then this would be a good use of exception wrapping. Would it be a good idea to make a custom aspx page and add these to customerrors, so that on init (not sure of the exact event), I can display exception info in the passed parameter on the page. However, a static html page can't do this so I don'开发者_Go百科t see the point in wrapping exceptions (unless there is a page or alert which uses the exception object). So if a project uses html pages for errors, is there a point in wrapping exceptions?

Thanks


You can use an error page to do this. I think for security reasons you should not display the full stack trace. Also it would not be very user friendly. You can catch the exception at teh highest level and then you can check and see what type of error it is and display a friendly message for that. I have seen this done in JSPs so I think you can do the same in ASP.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜