NickCraver / StackExchange.Exceptional

Error handler used for the Stack Exchange network
https://nickcraver.com/StackExchange.Exceptional/
Apache License 2.0
858 stars 170 forks source link

IStartupFilter for capturing .Configure() errors #191

Closed NickCraver closed 3 years ago

NickCraver commented 3 years ago

This should solve the problem of a not-yet-configured Exceptional when we're inside .Configure(). Until the first time the settings are resolved, we don't do the configuration, so the solution here is to cause said resolution ahead of app configuration.

Given we're adding ExceptionalSettings at the same time as we're adding the IStartupFilter, I think we're safe to assume it's always there. Thoughts @deanward81? I flip/flopped on null checking and .GetRequiredService here, curious whatcha think.

NickCraver commented 3 years ago

@deanward81 pinging for eyes once more because there was a duplicate registration in there - read it wrong on first pass. First implementation calls the second.