企业库4.1例外政策

时间:2020-12-24 20:19:19

I am using Enterprise Library 4.1 and want to implement Exception handling and logging. I am able to setup one policy that handles general Exceptions of the System.Exception type. I call this policy 'Data Access Policy'.

我正在使用Enterprise Library 4.1并希望实现异常处理和日志记录。我能够设置一个策略来处理System.Exception类型的常规异常。我将此政策称为“数据访问政策”。

In a general application development rule, how many policies should I create? What are the best practices for catching SqlExceptions? Should a separate policy be defined?

在一般的应用程序开发规则中,我应该创建多少策略?捕获SqlExceptions的最佳做法是什么?是否应该制定单独的政策?

What I am looking for is some suggestions from folks who develop applications using Enterprise Library and how they setup the policies for exception handling and some examples would help.

我正在寻找的是那些使用Enterprise Library开发应用程序的人以及他们如何设置异常处理策略的一些建议,一些例子会有所帮助。

Thanks

2 个解决方案

#1


You can add a new policy for SqlExceptions.

您可以为SqlExceptions添加新策略。

Here is a great post for you: Enterprise Library 4.1 :: Exception Handling Application Block

这是一篇很棒的文章:Enterprise Library 4.1 ::异常处理应用程序块

#2


It's probably a bit late for you now but this link may help someone else. It's a page from the Enterprise Library documentation entitled "Determining Appropriate Exception Policies and Actions" and does exactly what it says on the tin

你现在可能有点晚了,但这个链接可能对别人有所帮助。它是企业库文档中的一个页面,标题为“确定适当的异常策略和操作”,并完全按照它在锡上所说的

#1


You can add a new policy for SqlExceptions.

您可以为SqlExceptions添加新策略。

Here is a great post for you: Enterprise Library 4.1 :: Exception Handling Application Block

这是一篇很棒的文章:Enterprise Library 4.1 ::异常处理应用程序块

#2


It's probably a bit late for you now but this link may help someone else. It's a page from the Enterprise Library documentation entitled "Determining Appropriate Exception Policies and Actions" and does exactly what it says on the tin

你现在可能有点晚了,但这个链接可能对别人有所帮助。它是企业库文档中的一个页面,标题为“确定适当的异常策略和操作”,并完全按照它在锡上所说的