Compare the following two error messages and think about which you would find more helpful. Then, the next time you are throwing exceptions with messages remember this post.
Can't create component 'ProductService' as it has dependencies to be satisfied. ProductService is waiting for the following dependencies: Services: - ABCCompany.Framework.Services.IInventoryService which was registered but is also waiting for dependencies. ControllerInventory is waiting for the following dependencies: Services: - ABCCompany.Controller.IInventoryRequestInterpreter which was not registered. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: Castle.MicroKernel.Handlers.HandlerException: Can't create component 'ProductService' as it has dependencies to be satisfied. ProductService is waiting for the following dependencies: Services: - ABCCompany.Framework.Services.IInventoryService which was registered but is also waiting for dependencies. ControllerInventory is waiting for the following dependencies: Services: - ABCCompany.Controller.IInventoryRequestInterpreter which was not registered.
Exception Details: Castle.MicroKernel.Handlers.HandlerException: Can't create component 'ProductService' as it has dependencies to be satisfied.
ProductService is waiting for the following dependencies:
Services: - ABCCompany.Framework.Services.IInventoryService which was registered but is also waiting for dependencies.
ControllerInventory is waiting for the following dependencies:
Services: - ABCCompany.Controller.IInventoryRequestInterpreter which was not registered.
Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
TestCase 'JPCycles.MVC.WebTests.HttpModules.HttpSecureTests.Verify_that_the_HttpSecure_blocks_listed_IPAddress'failed: TypeMock.TypeMockException : *** Typemock Isolator is not currently enabled. To enable do one of the following:* To run Typemock Isolator as part of an automated process you can: - run tests via TMockRunner.exe command line tool - use 'TypeMockStart' tasks for MSBuild or NAnt* To work with Typemock Isolator inside Visual Studio.NET: set Tools->Enable Typemock Isolator from within Visual StudioFor more information consult the documentation (see 'Running' topic) at TypeMock.MockManager.Init(Boolean collectAllCalls) at TypeMock.MockManager.e(Type A_0) at TypeMock.MockManager.Mock(Type type, Constructor mockConstructors) at TypeMock.MockManager.MockObject(Type type, Constructor mockConstructors, Object[] args) at TypeMock.MockManager.MockObject[TMockedType]() C:\Web\src\JPCycles.MVC.WebTests\HttpModules\HttpSecureTests.cs(19,0): at JPCycles.MVC.WebTests.HttpModules.HttpSecureTests.Verify_that_the_HttpSecure_blocks_listed_IPAddress()0 passed, 1 failed, 0 skipped, took 2.05 seconds.
This blog contains the thoughts and discoveries of Tim Barcz, a technologist with a interests in computer programming technologies.