Error Problem
shema-ryan opened this issue · 0 comments
Am using workbench 8.0 but the packages seems not to capture any form of error ,
during the connectionSettings parameters i wrongly typed the db_name but it was still showing successfully connected ,
putting that beside , try{}catch doesn't catch any query error.
// here is sample of the my code
class Database {
late final MySqlConnection dbHandler;
static final configuration = ConnectionSettings(
db: 'windows_app',
user: 'root6',
password: 'hackermood',
port: 3306,
);
Future connectDb() async {
try {
dbHandler = await MySqlConnection.connect(configuration);
}
on MySqlClientError catch (error) {
print(error.toString());
} on SocketException catch(error){
print('we have captured this error');
}
catch (error) {
print(error.toString());
}
}
}
in my init state i do call Database().connectdb but still can't receive any form of error.