Closed mathiash98 closed 2 years ago
Thanks for reporting this! However... 😉
I just tried to replicate the issue using this test case, but I could not make it lose the inner exception in any of the cases.
A malformed connection string was used for transport, subscriptions, sagas, timeouts, and the outbox, but they all gave me an error message like this:
Rebus.Injection.ResolutionException: Could not resolve Rebus.Subscriptions.ISubscriptionStorage with decorator depth 0 - registrations: Rebus.Injection.Injectionist+Handler
---> System.ArgumentException: Keyword not supported: 'inital catalog'.
at Microsoft.Data.Common.DbConnectionOptions.ParseInternal(Dictionary`2 parsetable, String connectionString, Boolean buildChain, Dictionary`2 synonyms, Boolean firstKey)
at Microsoft.Data.Common.DbConnectionOptions..ctor(String connectionString, Dictionary`2 synonyms)
at Microsoft.Data.SqlClient.SqlConnectionString..ctor(String connectionString)
at Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous)
at Microsoft.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey key, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions)
(...)
i.e. with a ResolutionException
wrapping an ArgumentException
.
I suspect you have somehow lost the inner exception somewhere else outside of Rebus... I'll close this issue for now, let me know if there's something I've missed in my attempt to replicate your issue 🙂
Thank you for the time spent
No problem! It's a good opportunity to get this particular area covered by tests 🙂
Had an issue where we had connectionstring like:
Server=tcp:xxx.database.windows.net,1433;Inital Catalog=sqldb_event_bus-staging;Persist Security Info=False;User ID=admin;Password=password;"
WhereInitial Catalog
was wrongly typed leading to unsuccessful connection.To debug further I disabled "just my code" in Visual Studio and found that we got
'System.ArgumentException' in System.Private.CoreLib.dll
saying:Keyword not supported: 'inital catalog'.'
. Further stepping in debug showed that innerException was kept for some stacks in Rebus. But then it got swallowed and crashed application.Exception thrown: 'Rebus.Injection.ResolutionException' in System.Private.CoreLib.dll
in the debug output panel, no message in the terminal, and no messages in the Azure App Service Console log neither.So the innerException should be thrown all the way out to where the application is crashing.