As I see there are two places (here and here) in a whole codebase where that exception could be thrown. So the problem there is no error code for that exception types. And when we want to handle situation when there is no connecton to MySQL database, we need to check the error code (it should be 0) and additionaly check exception message. I think it would be better to add additional enum value into MySqlErrorCode to handle that situation (specially with when clauses).
The text was updated successfully, but these errors were encountered:
I wonder if Connector/NET may have co-opted ER_BAD_HOST_ERROR (1042) to mean "can't connect to server"? The "right" client-side error code might be CR_CONNECTION_ERROR (2002) or CR_CONN_HOST_ERROR (2003). Nevertheless, the precedent for .NET is set now.