String tableName = ByteBufferUtil.toString(args.get(0));
switch (e.getCode()) {
case TABLE_DOESNT_EXIST:
throw new TableNotFoundException(null, tableName, "Target table does not exist");
case NAMESPACE_DOESNT_EXIST:
throw new NamespaceNotFoundException(null, tableName, "Target namespace does not exist");
default:
String tableInfo = Tables.getPrintableTableInfoFromName(instance, tableName);
throw new AccumuloSecurityException(e.user, e.code, tableInfo, e);
}
} catch (ThriftTableOperationException e) {
switch (e.getType()) {
case EXISTS:
throw new TableExistsException(e);
case NOTFOUND:
throw new TableNotFoundException(e);
case NAMESPACE_EXISTS:
throw new NamespaceExistsException(e);
case NAMESPACE_NOTFOUND:
throw new NamespaceNotFoundException(e);
case OFFLINE:
throw new TableOfflineException(instance, null);
default:
throw new AccumuloException(e.description, e);
}