-
-
Notifications
You must be signed in to change notification settings - Fork 837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include inner exception message in outer exception message when wrapping exceptions from constructors #343
Comments
From [email protected] on January 22, 2012 21:14:05 Thanks Rikard, sounds like a good suggestion. Status: Accepted |
From [email protected] on January 22, 2012 21:16:33 Summary: Include inner exception message in outer exception message when wrapping exceptions from constructors |
From travis.illig on September 21, 2012 09:33:31 Labels: Module-Core |
From [email protected] on September 25, 2012 02:05:00 In the mean time, is it possible to log the exception? |
From travis.illig on January 02, 2013 12:26:27 Owner: travis.illig |
From travis.illig on January 02, 2013 12:45:13 The message for DependencyResolutionException now includes the inner exception message if there is one. It will appear like: "Unable to resolve component. ---> Can't find file. (See inner exception for details.)" If the complete stack trace and everything for the inner exception is desired, use ToString as with other exception types. There is currently no logging built into Autofac. If you want the exception logged, I'd recommend implementing a logging solution in your project. Adding logging to Autofac is outside the scope of this issue. Status: Fixed |
From [email protected] on September 06, 2011 17:39:15
I have a problem propagating exceptions from my library.
For example:
public class ThrowException
{
public ThrowException()
{
throw new FileNotFoundException("Can't find file");
}
}
[TestMethod]
public void CorrectExceptionWhenResolving()
{
var builder = new ContainerBuilder();
builder.RegisterType();
var container = builder.Build();
}
Ideally I would like to catch FileNotFoundException, but I understand why that is not possible.
What I think would be great is that DependencyResolutionException message contains inner exception message. That way I don't need to explain to users that they should look at the inner exception instead of main exception.
For example this message "An exception was thrown while invoking the constructor 'Void .ctor()' on type 'ThrowException'. Exception: Can't find file" would be much better.
Regards,
Rikard
Original issue: http://code.google.com/p/autofac/issues/detail?id=343
The text was updated successfully, but these errors were encountered: