@@ -42,14 +42,14 @@ public Void enableTable(String tableName) throws IOException, TableNotFoundExcep
42
42
requestData .put ("table_name" , tableName );
43
43
String jsonData = JSON .toJSONString (requestData );
44
44
request .setData (jsonData );
45
- try {
45
+ try {
46
46
return execute (tableClient , request );
47
47
} catch (IOException e ) {
48
48
Throwable cause = e .getCause ();
49
49
if (cause instanceof ObTableException ) {
50
50
ObTableException obEx = (ObTableException ) cause ;
51
51
int errCode = obEx .getErrorCode ();
52
- if (ResultCodes .OB_KV_TABLE_NOT_DISABLED .errorCode == errCode ) {
52
+ if (ResultCodes .OB_KV_TABLE_NOT_ENABLED .errorCode == errCode ) {
53
53
throw new TableNotEnabledException ("Table is not enabled: " + tableName + obEx );
54
54
} else if (ResultCodes .OB_TABLEGROUP_NOT_EXIST .errorCode == errCode ) {
55
55
throw new TableNotFoundException ("Table not found: " + tableName + obEx );
@@ -66,15 +66,15 @@ public Void disableTable(String tableName) throws IOException, TableNotFoundExce
66
66
requestData .put ("table_name" , tableName );
67
67
String jsonData = JSON .toJSONString (requestData );
68
68
request .setData (jsonData );
69
- try {
69
+ try {
70
70
return execute (tableClient , request );
71
71
} catch (IOException e ) {
72
72
Throwable cause = e .getCause ();
73
73
if (cause instanceof ObTableException ) {
74
74
ObTableException obEx = (ObTableException ) cause ;
75
75
int errCode = obEx .getErrorCode ();
76
76
if (ResultCodes .OB_KV_TABLE_NOT_DISABLED .errorCode == errCode ) {
77
- throw new TableNotEnabledException ("Table is not enabled : " + tableName + obEx );
77
+ throw new TableNotDisabledException ("Table is not disabled : " + tableName + obEx );
78
78
} else if (ResultCodes .OB_TABLEGROUP_NOT_EXIST .errorCode == errCode ) {
79
79
throw new TableNotFoundException ("Table not found: " + tableName + obEx );
80
80
}
0 commit comments