@@ -67,7 +67,7 @@ public void createDatabase(Database database){
67
67
} catch (AlreadyExistsException e ) {
68
68
throw new SchemaAlreadyExistsException (database .getName (), e );
69
69
} catch (Exception e ) {
70
- throw new PrestoException (HIVE_METASTORE_ERROR , e );
70
+ throw new PrestoException (HIVE_METASTORE_ERROR , "Internal server error creating database" , e );
71
71
}
72
72
}
73
73
@@ -79,7 +79,7 @@ public void updateDatabase(Database database){
79
79
} catch (MetaException | InvalidObjectException e ) {
80
80
throw new InvalidMetaException ("Invalid metadata for " + database .getName (), e );
81
81
} catch (Exception e ) {
82
- throw new PrestoException (HIVE_METASTORE_ERROR , e );
82
+ throw new PrestoException (HIVE_METASTORE_ERROR , "Internal server error updating database" , e );
83
83
}
84
84
}
85
85
@@ -90,7 +90,7 @@ public void dropDatabase(String dbName) {
90
90
catch (NoSuchObjectException e ) {
91
91
throw new SchemaNotFoundException (dbName );
92
92
}catch (Exception e ) {
93
- throw new PrestoException (HIVE_METASTORE_ERROR , e );
93
+ throw new PrestoException (HIVE_METASTORE_ERROR , "Internal server error dropping database" , e );
94
94
}
95
95
}
96
96
@@ -102,7 +102,7 @@ public void alterTable(final Table table) {
102
102
} catch (AlreadyExistsException e ) {
103
103
throw new TableAlreadyExistsException (new SchemaTableName (table .getDbName (), table .getTableName ()));
104
104
} catch (Exception e ) {
105
- throw new PrestoException (HIVE_METASTORE_ERROR , e );
105
+ throw new PrestoException (HIVE_METASTORE_ERROR , "Internal server error altering table" , e );
106
106
}
107
107
}
108
108
@@ -111,7 +111,7 @@ public List<Table> getTablesByNames(String dbName, List<String> tableNames) {
111
111
try (HiveMetastoreClient client = clientProvider .createMetastoreClient ()){
112
112
return client .get_table_objects_by_name ( dbName , tableNames );
113
113
} catch (Exception e ) {
114
- throw new PrestoException (HIVE_METASTORE_ERROR , e );
114
+ throw new PrestoException (HIVE_METASTORE_ERROR , "Internal server error fetching tables" , e );
115
115
}
116
116
}
117
117
@@ -121,7 +121,7 @@ public List<Partition> getPartitions(String dbName, String tableName, String fil
121
121
} catch (NoSuchObjectException e ) {
122
122
throw new TableNotFoundException (new SchemaTableName (dbName , tableName ), e );
123
123
}catch (Exception e ) {
124
- throw new PrestoException (HIVE_METASTORE_ERROR , e );
124
+ throw new PrestoException (HIVE_METASTORE_ERROR , String . format ( "Internal server error fetching partitions for table %s.%s" , dbName , tableName ), e );
125
125
}
126
126
}
127
127
@@ -131,7 +131,7 @@ public List<Partition> getPartitions(String dbName, String tableName, List<Strin
131
131
} catch (NoSuchObjectException e ) {
132
132
throw new TableNotFoundException (new SchemaTableName (dbName , tableName ), e );
133
133
}catch (Exception e ) {
134
- throw new PrestoException (HIVE_METASTORE_ERROR , e );
134
+ throw new PrestoException (HIVE_METASTORE_ERROR , String . format ( "Internal server error fetching partitions for table %s.%s" , dbName , tableName ), e );
135
135
}
136
136
}
137
137
@@ -145,7 +145,7 @@ public void addDropPartitions(String dbName, String tableName,
145
145
} catch (MetaException | InvalidObjectException e ) {
146
146
throw new InvalidMetaException ("One or more partitions are invalid." , e );
147
147
} catch (Exception e ) {
148
- throw new PrestoException (HIVE_METASTORE_ERROR , e );
148
+ throw new PrestoException (HIVE_METASTORE_ERROR , String . format ( "Internal server error adding/dropping partitions for table %s.%s" , dbName , tableName ), e );
149
149
}
150
150
}
151
151
@@ -155,7 +155,7 @@ public void savePartitions(List<Partition> partitions) {
155
155
} catch (MetaException | InvalidObjectException e ) {
156
156
throw new InvalidMetaException ("One or more partitions are invalid." , e );
157
157
} catch (Exception e ) {
158
- throw new PrestoException (HIVE_METASTORE_ERROR , e );
158
+ throw new PrestoException (HIVE_METASTORE_ERROR , "Internal server error saving partitions" , e );
159
159
}
160
160
}
161
161
@@ -167,7 +167,7 @@ public void alterPartitions(String dbName, String tableName, List<Partition> par
167
167
} catch (MetaException | InvalidObjectException e ) {
168
168
throw new InvalidMetaException ("One or more partitions are invalid." , e );
169
169
} catch (Exception e ) {
170
- throw new PrestoException (HIVE_METASTORE_ERROR , e );
170
+ throw new PrestoException (HIVE_METASTORE_ERROR , String . format ( "Internal server error altering partitions for table %s.%s" , dbName , tableName ), e );
171
171
}
172
172
}
173
173
@@ -177,7 +177,7 @@ public void dropPartitions( String dbName, String tableName, List<String> partit
177
177
} catch (NoSuchObjectException e ) {
178
178
throw new TableNotFoundException (new SchemaTableName (dbName , tableName ), e );
179
179
}catch (Exception e ) {
180
- throw new PrestoException (HIVE_METASTORE_ERROR , e );
180
+ throw new PrestoException (HIVE_METASTORE_ERROR , String . format ( "Internal server error dropping partitions for table %s.%s" , dbName , tableName ), e );
181
181
}
182
182
}
183
183
0 commit comments