English 中文(简体)
团结是该决议的例外。 如何避免?
原标题:Unity wraps exception to the ResolutionFailedException. How to avoid?

I want to know, is there the possibility to ask Unity "do not wrap any user exceptions at resolve time"?

确实,为什么团结为“解放阵线”作总结? 正在改变“建筑服务合同”,IMHO利用团结进行初始化的目标这一事实应当透明,这意味着如果客户等待“新”运营商的IOException,那么即便是使用团结制造物体,也应当使其失效。

其他IoC集装箱是否也一样?

最佳回答
问题回答

ResolutionFailedException.InnerException

正在改变“建筑服务合同”

什么合同?

IMHO the fact of objects initialization using unity should be transparent

IoC集装箱的一个点是使物体的构造减少重点,从而使开发商能够侧重于增加商业价值。

这意味着,如果客户等待“新”运营商的IOException,那么即使使用团结方式,也应当使其失效。

谁,客户使用希望<代码>IOException的集装箱? 我认为你可能误用你的IoC集装箱。

理由统一归纳了合同方面的所有例外,即确定方法的合同。

在决意消失时,什么申请应当赶上? 支持者确实解决了你知道的那类人扔下了IOException。 因此,你在下决心呼吁下对这一例外作出追索。

然后,执行工作发生变化。 或只是组合。 如今,这些服务会带来其他东西。

Now you ve got a configuration change that will require a code change. Not good.

A second reason that with the wrapped exception the container has a place to put diagnostic information about where in the resolve process the failure occurred.

I had a similar need and found a solution here: catch all unhandled exceptions in ASP.NET Web Api

Here s what I learned when reviewing answers from the linked article:

  • If you only want to catch the exceptions and log them, then add an IExceptionLogger.
  • If you want to catch the exception and manipulate the response, then replace IExceptionHandler.
  • Neither solution captures ALL exceptions. I m still using Application_Error to capture exceptions that aren t caught within my ApiController methods.




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签