How do I handle SharePoint exceptions?

前端 未结 4 1383
天命终不由人
天命终不由人 2021-01-07 00:24

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 g

4条回答
  •  一向
    一向 (楼主)
    2021-01-07 01:02

    We allow all our exceptions to bubble up and use a custom HTTP module to handle all exceptions. From here, we log to the ULS logs and also to the trace logs. This is mostly lifted from SharePoint MVP Chris O'brien's Code

    We only catch exceptions if we feel we can add extra value to the exception, and then re-throw the error, allowing the http module to pick it up.

提交回复
热议问题