Closed bsutton closed 2 years ago
Hi. I've refactored exceptions. Now all general Exceptions are gone. See https://github.com/zim32/mysql.dart/blob/main/lib/exception.dart what's instead.
Can I suggest that they all extend a single base class MySqlException.
This will allow a user to catch any of them worth a single catch clause it individual exceptions.
I common error code in the base class would also be useful so you can really detect errors such as login failed, deadlocks etc.
On Mon, 16 May 2022, 9:20 pm zim32, @.***> wrote:
Hi. I've refactored exceptions. Now all general Exceptions are gone. See https://github.com/zim32/mysql.dart/blob/main/lib/exception.dart what's instead.
— Reply to this email directly, view it on GitHub https://github.com/zim32/mysql.dart/issues/20#issuecomment-1127545403, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAG32OBXZUHFDGSPCUSXMMLVKIVOFANCNFSM5V6QLZCA . You are receiving this because you authored the thread.Message ID: @.***>
Can you see latest code in git and say is it ok now?
Structure looks good.
Is it possible to extract the SQL error code and make it available in the exception.
i often check for specific error codes
On Wed, 18 May 2022, 4:04 am zim32, @.***> wrote:
Can you see latest code in git and say is it ok now?
— Reply to this email directly, view it on GitHub https://github.com/zim32/mysql.dart/issues/20#issuecomment-1129162989, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAG32ODHYYXX2WCPEKMTT7TVKPNRTANCNFSM5V6QLZCA . You are receiving this because you authored the thread.Message ID: @.***>
Nice feature. I will do it
Server error code is now exposed in MySQLServerException through errorCode prop Release 0.0.19
Just trying to adapt your library into my package simple_mysql_orm.
Firstly thanks for the work.
One issue I note is that you throw a generic Exception class from the libraries.
I'm wondering if you would consider changing this it a more specific class such as MySQLException as this makes it easier to catch and differentiate from other possible exceptions.