如何处理 SharePoint 异常? [英] How do I handle SharePoint exceptions?

查看:38
本文介绍了如何处理 SharePoint 异常?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 SharePoint 的新手,所以我想我需要如何处理异常?当我编写自定义代码时,我是否必须检查它们,或者如果它们被抛出,它们会自动记录并且不会破坏应用程序?

I`m new to SharePoint, so I guess how do I need to handle exceptions? When I write custom code do I have to check for them or maybe, if they are thrown, they automatically get logged and don't break the app?

如果没有,那么我如何记录它们?

If not, then how do I log them?

谢谢!

我应该如何记录这些异常?

And how should I log those exceptions?

推荐答案

使用此写入日志:http://msdn.microsoft.com/en-us/library/aa979522.aspx

除非您处理异常,否则应用程序很可能会中断.一些错误,例如在事件接收器中生成的错误,不会破坏"应用程序(终止事件接收器除外).除非您更改了中央管理中的设置,否则这些以及所有其他未捕获的错误将最终出现在日志中.

Unless you handle your exceptions the application will most likely break. Some errors such as those generated in event receivers will not "break" the application (except for terminating the event receiver). Those, along with all other uncatched errors will end up in the log unless you've changed the settings in central admin.

这篇关于如何处理 SharePoint 异常?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆