Exception messages in Unity 2 - improved?

Mar 30, 2010 at 8:22 AM
Edited Mar 30, 2010 at 8:26 AM

I recall that in 1.2, the exception messages were almost unintelligible: "Something something when building object graph bla bla bla" - directly from ObjectBuilder and without any Unity context whatsoever. Has this improved in 2.0? The difficulty in understanding exceptions made debugging a lot harder than it should have been. Compare some cryptic object build exception to "Named dependency Foo of type Bar cannot be resolved", for example.

The exceptions made me wary of using Unity when junior developers would be working on the project - they might not understand how Unity works (heck, I don't understand the internals, either, and I don't really care about it as long as I have my dependencies being injected).

Note: I might misremember how cryptic they were but in any case, it was a definite problem that the cause of the exception was not obvious from the message. For example, the exception was that type Foo could not be consturcted, but the real error was that some depdenency 10 levels down could not be constructed - that was the error that needed to be fixed but you had to dig real deep in the exceptions to find that out.

Mar 31, 2010 at 3:26 AM

Improving the error messages was literally the first feature we implemented for Unity 2.0 about eight months ago. Yes, they're vastly better. Why not go download the beta 2 release and find out for yourself?


Mar 31, 2010 at 8:16 AM

Excellent! :)