mysql1_dart icon indicating copy to clipboard operation
mysql1_dart copied to clipboard

Error Problem

Open shema-ryan opened this issue 3 years ago • 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.

shema-ryan avatar Sep 27 '22 12:09 shema-ryan