use of com.thinkbiganalytics.rest.model.RestResponseStatus in project kylo by Teradata.
the class DataSourceController method doListTables.
private List<DataSetTable> doListTables(@QueryParam("catalog") String catalogName, @QueryParam("schema") String schemaName, DataSource dataSource) {
final List<DataSetTable> tables;
try {
log.debug("List tables for catalog:{} schema:{}", catalogName, schemaName);
tables = tableManager.listCatalogsOrTables(dataSource, catalogName, schemaName);
} catch (final Exception e) {
if (exceptionTransformer.causesInChain(e)) {
throw new ThriftConnectionException(e);
}
if (log.isErrorEnabled()) {
log.error("Failed to list tables for catalog [" + catalogName + "] schema [" + schemaName + "]: " + e, e);
}
final RestResponseStatus status = new RestResponseStatus.ResponseStatusBuilder().message(getMessage("catalog.datasource.listTables.error", catalogName, schemaName)).url(request.getRequestURI()).setDeveloperMessage(e).buildError();
throw new InternalServerErrorException(Response.serverError().entity(status).build());
}
return tables;
}
Aggregations