Hi guys. I've got this code:
try {
_mySqlConnection = _mySql.OpenDb(_configuration.AldaBansHost,
_configuration.AldaBansPort,_configuration.AldaBansDatabase,
_configuration.AldaBansUsername,_configuration.AldaBansPassword, this, true);
} catch (MysqlException e) {
PrintError("Mysql error! " + e.Message());
}The problem is, The exception is not catched. When I close my mysql database ( disable the server ), I get this error:
MySql handle raised an exception in 'Testbansystem v0.1.0' plugin (MySqlException: Unable to connect to any of the specified MySQL hosts.)
at MySql.Data.MySqlClient.NativeDriver.Open () [0x00057] in <8d7380b3d3cf4bd8be324c584f371b44>:0
at MySql.Data.MySqlClient.Driver.Open () [0x0000b] in <8d7380b3d3cf4bd8be324c584f371b44>:0
at MySql.Data.MySqlClient.Driver.Create (MySql.Data.MySqlClient.MySqlConnectionStringBuilder settings) [0x0004d] in <8d7380b3d3cf4bd8be324c584f371b44>:0
at MySql.Data.MySqlClient.MySqlConnection.Open () [0x0016c] in <8d7380b3d3cf4bd8be324c584f371b44>:0
at Oxide.Core.MySql.Libraries.MySql+MySqlQuery.Handle () [0x00059] in <79d157ef50864cd6a493ea45b8d9c402>:0why does my try catch block doesn't work? Even when I use only catch without (), and even if I use catch (Exception e) , The catch block is never called. It instead prints this same message again.