use of io.vertx.mysqlclient.MySQLException in project Mycat2 by MyCATApache.
the class NewVertxConnectionImpl method mapException.
private static Throwable mapException(Throwable throwable) {
if (throwable instanceof MySQLException) {
MySQLException mySQLException = (MySQLException) throwable;
int errorCode = mySQLException.getErrorCode();
String sqlState = mySQLException.getSqlState();
String message = mySQLException.getMessage();
throwable = new SQLException(message, sqlState, errorCode, throwable);
}
return throwable;
}
use of io.vertx.mysqlclient.MySQLException in project Mycat2 by MyCATApache.
the class Decoder method convertException.
default Throwable convertException(Buffer payload) {
ReadView readView = new ReadView(payload);
readView.skipInReading(1);
int errorCode = (int) readView.readFixInt(2);
readView.skipInReading(1);
String sqlState = readView.readFixString(5);
String errorMessage = readView.readEOFString();
return (new MySQLException(errorMessage, errorCode, sqlState));
}
Aggregations