使用Exception.Data [英] Using Exception.Data

查看:132
本文介绍了使用Exception.Data的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你是如何使用在你参与的C#项目Exception.Data财产?

How have you used the Exception.Data property in C# projects that you've worked on?

我想答案是提出一个模式,而不是那些非常具体到您的应用程序。

I'd like answers that suggest a pattern, rather than those that are very specific to your app.

推荐答案

例外记录我使用已经调整到写出来的数据集合中的所有项目。那么对于我们遇到的,我们不能从异常堆栈诊断每一个例外,我们添加在该函数的范围内的所有数据,发出一个新的版本,并等待它再次发生。

The exception logger I use has been tweaked to write out all the items in the Data collection. Then for every exception we encounter that we cannot diagnose from the exception stack, we add in all the data in that function's scope, send out a new build, and wait for it to reoccur.

我想我们在乐观的,我们不把它放在每一个功能,但我们在悲观主义者,我们不把它拿出来一旦我们解决问题。

I guess we're optimists in that we don't put it in every function, but we are pessimists in that we don't take it out once we fix the issue.

这篇关于使用Exception.Data的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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