Hi! It might be nice to add more specific failure ...
# jasync-sql
d
Hi! It might be nice to add more specific failure types to
QueryResult
like if a Unique index was violated (maybe a setting to get an exception for that...?). Currently there's no real way to distinguish a generic failure in doing an insert, or a more specific one (unless we parse the error message?) @oshai?
o
I think the driver itself is low-level so it's enough to provide error codes, and it is also what was done before and will break things to change that. but it should be possible to use error codes. see: https://github.com/jasync-sql/jasync-sql/blob/e9896d615b3b997ca0f05a67f21f6ab40f54bbaf/r2dbc-mysql/src/main/java/JasyncStatement.kt#L110
d
Ok, thanks for that link! I didn't realize that there was an
errorCode
field (I also didn't think about casting to
MySQLException
...), it might be a nice addition to the Wiki... (if it's not there yet...).
o
I will add it to the wiki, of course for postgres you need a different cast