提交 f9a1d1ef 编写于 作者: Q qiaojialin

change exception message

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