提交 f9a1d1ef 编写于 作者: Q qiaojialin

change exception message

上级 d9e821ec
......@@ -33,6 +33,9 @@ import org.apache.iotdb.jdbc.Config;
import org.apache.iotdb.jdbc.IoTDBConnection;
import org.apache.thrift.TException;
/**
* usage: -h 127.0.0.1 -p 6667 -u root -pw root
*/
public class Client extends AbstractClient {
private static CommandLine commandLine;
......
......@@ -424,7 +424,7 @@ public class IoTDBConnection implements Connection {
} catch (IoTDBRPCException e) {
// failed to connect, disconnect from the server
transport.close();
throw new IoTDBSQLException(e);
throw new IoTDBSQLException(e.getMessage());
}
if (protocolVersion.getValue() != openResp.getServerProtocolVersion().getValue()) {
throw new TException(String
......@@ -485,7 +485,7 @@ public class IoTDBConnection implements Connection {
try {
RpcUtils.verifySuccess(resp.getStatus());
} catch (IoTDBRPCException e) {
throw new IoTDBSQLException(e);
throw new IoTDBSQLException(e.getMessage());
}
return resp.getTimeZone();
}
......@@ -496,7 +496,7 @@ public class IoTDBConnection implements Connection {
try {
RpcUtils.verifySuccess(resp.getStatus());
} catch (IoTDBRPCException e) {
throw new IoTDBSQLException(e);
throw new IoTDBSQLException(e.getMessage());
}
this.zoneId = ZoneId.of(zoneId);
}
......
......@@ -87,7 +87,7 @@ public class IoTDBDatabaseMetadata implements DatabaseMetaData {
try {
RpcUtils.verifySuccess(resp.getStatus());
} catch (IoTDBRPCException e) {
throw new IoTDBSQLException(e);
throw new IoTDBSQLException(e.getMessage());
}
return new IoTDBMetadataResultSet(resp.getColumnsList(), null, null);
} catch (TException e) {
......@@ -101,7 +101,7 @@ public class IoTDBDatabaseMetadata implements DatabaseMetaData {
try {
RpcUtils.verifySuccess(resp.getStatus());
} catch (IoTDBRPCException e) {
throw new IoTDBSQLException(e);
throw new IoTDBSQLException(e.getMessage());
}
return new IoTDBMetadataResultSet(resp.getColumnsList(), null, null);
} catch (TException e) {
......@@ -114,7 +114,7 @@ public class IoTDBDatabaseMetadata implements DatabaseMetaData {
try {
RpcUtils.verifySuccess(resp.getStatus());
} catch (IoTDBRPCException e) {
throw new IoTDBSQLException(e);
throw new IoTDBSQLException(e.getMessage());
}
Set<String> showStorageGroup = resp.getShowStorageGroups();
return new IoTDBMetadataResultSet(null, showStorageGroup, null);
......@@ -129,7 +129,7 @@ public class IoTDBDatabaseMetadata implements DatabaseMetaData {
try {
RpcUtils.verifySuccess(resp.getStatus());
} catch (IoTDBRPCException e) {
throw new IoTDBSQLException(e);
throw new IoTDBSQLException(e.getMessage());
}
List<List<String>> showTimeseriesList = resp.getShowTimeseriesList();
return new IoTDBMetadataResultSet(null, null, showTimeseriesList);
......@@ -1268,7 +1268,7 @@ public class IoTDBDatabaseMetadata implements DatabaseMetaData {
try {
RpcUtils.verifySuccess(resp.getStatus());
} catch (IoTDBRPCException e) {
throw new IoTDBSQLException(e);
throw new IoTDBSQLException(e.getMessage());
}
return resp.getMetadataInJson();
}
......
......@@ -713,7 +713,7 @@ public class IoTDBQueryResultSet implements ResultSet {
try {
RpcUtils.verifySuccess(resp.getStatus());
} catch (IoTDBRPCException e) {
throw new IoTDBSQLException(e);
throw new IoTDBSQLException(e.getMessage());
}
if (!resp.hasResultSet) {
emptyResultSet = true;
......
......@@ -251,7 +251,7 @@ public class IoTDBStatement implements Statement {
try {
RpcUtils.verifySuccess(execResp.getStatus());
} catch (IoTDBRPCException e) {
throw new IoTDBSQLException(e);
throw new IoTDBSQLException(e.getMessage());
}
if (execResp.getOperationHandle().hasResultSet) {
IoTDBQueryResultSet resSet = new IoTDBQueryResultSet(this,
......@@ -355,7 +355,7 @@ public class IoTDBStatement implements Statement {
try {
RpcUtils.verifySuccess(execResp.getStatus());
} catch (IoTDBRPCException e) {
throw new IoTDBSQLException(e);
throw new IoTDBSQLException(e.getMessage());
}
IoTDBQueryResultSet resSet = new IoTDBQueryResultSet(this, execResp.getColumns(), client,
operationHandle, sql, execResp.getOperationType(), execResp.getDataTypeList(),
......@@ -412,7 +412,7 @@ public class IoTDBStatement implements Statement {
try {
RpcUtils.verifySuccess(execResp.getStatus());
} catch (IoTDBRPCException e) {
throw new IoTDBSQLException(e);
throw new IoTDBSQLException(e.getMessage());
}
return 0;
}
......
......@@ -510,7 +510,7 @@ public class IoTDBAggregationIT {
resultSet.next();
fail();
} catch (Exception e) {
Assert.assertEquals("org.apache.iotdb.rpc.IoTDBRPCException: Unsupported data type in aggregation MEAN : TEXT", e.getMessage());
Assert.assertEquals("Unsupported data type in aggregation MEAN : TEXT", e.getMessage());
}
statement.close();
......@@ -523,7 +523,7 @@ public class IoTDBAggregationIT {
resultSet.next();
fail();
} catch (Exception e) {
Assert.assertEquals("org.apache.iotdb.rpc.IoTDBRPCException: Unsupported data type in aggregation SUM : TEXT", e.getMessage());
Assert.assertEquals("Unsupported data type in aggregation SUM : TEXT", e.getMessage());
}
statement.close();
......@@ -536,7 +536,7 @@ public class IoTDBAggregationIT {
resultSet.next();
fail();
} catch (Exception e) {
Assert.assertEquals("org.apache.iotdb.rpc.IoTDBRPCException: Unsupported data type in aggregation MEAN : BOOLEAN", e.getMessage());
Assert.assertEquals("Unsupported data type in aggregation MEAN : BOOLEAN", e.getMessage());
}
statement.close();
......@@ -549,7 +549,7 @@ public class IoTDBAggregationIT {
resultSet.next();
fail();
} catch (Exception e) {
Assert.assertEquals("org.apache.iotdb.rpc.IoTDBRPCException: Unsupported data type in aggregation SUM : BOOLEAN", e.getMessage());
Assert.assertEquals("Unsupported data type in aggregation SUM : BOOLEAN", e.getMessage());
}
statement.close();
} catch (Exception e) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册