Skip to content
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

Allow use of current ILifetimeScope in the exception callback #47

Open
RemcoBlok opened this issue Nov 26, 2018 · 1 comment
Open

Allow use of current ILifetimeScope in the exception callback #47

RemcoBlok opened this issue Nov 26, 2018 · 1 comment

Comments

@RemcoBlok
Copy link

RemcoBlok commented Nov 26, 2018

Great to see the addition of the constructorExceptionCallback in release 2.1.0. I need to be able to resolve my logger instance in the callback. Is it possible to change the callback signature from Action<Exception> to Action<IComponentContext, Exception>?

@tillig
Copy link
Member

tillig commented Jan 25, 2019

It appears currently the callback is run after the lifetime scope is disposed so that will need to be updated. It'll also have to be safe such that if an exception is thrown during the callback the disposal of the scope will still be executed. It's simpler how it is now, which is not to say it's not possible to change, just that it's not "reorder the statements and call it good." Back compat is also a consideration, so we'll need overloads to handle it, not replacement of the existing thing.

@tillig tillig changed the title need IComponentContext in constructorExceptionCallback Allow use of current ILifetimeScope in the exception callback Jan 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants