Replies: 1 comment
-
Can you catch the exception in a method on the call stack that has the relevant DbContext or DbConnection in scope and log its details (and rethrow the exception or throw your own wrapper around the exception as necessary)? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi
I have a ASP.NET Core app which includes three different entity framework core contexts (all three for mysql server).
I now have the problem, that if one of the DBs (or respective the host) is offline aka the context isn't able to connect, I get a
MySqlException
with message depending on the actual problem e.g.Unable to connect to any of the specified MySql hosts
orConnection Timeout expired
.The thing is, that this isn't terribly helpful, since any of the three DBs can be affected and I don't want to play a quiz which one...
Is there any way to get some details about which context failed (e.g. the connection string,...)? It is enough for the first step to only get the host which has the problem.
Beta Was this translation helpful? Give feedback.
All reactions