presto-thrift/src/main/java/io/prestosql/plugin/thrift/util/ThriftExceptions.java/ThriftExceptions/toPrestoException
class ThriftExceptions:    public static PrestoException toPrestoException(Exception e)
    {
        if ((e instanceof TTransportException) && "No hosts available".equals(e.getMessage())) {
            throw new PrestoException(THRIFT_SERVICE_NO_AVAILABLE_HOSTS, e);
        }
        if ((e instanceof TApplicationException) || (e instanceof PrestoThriftServiceException)) {
            return new PrestoException(THRIFT_SERVICE_GENERIC_REMOTE_ERROR, "Exception raised by remote Thrift server: " + e.getMessage(), e);
        }
        if (e instanceof TException) {
            return new PrestoException(THRIFT_SERVICE_CONNECTION_ERROR, "Error communicating with remote Thrift server", e);
        }
        throw new PrestoException(GENERIC_INTERNAL_ERROR, e);
    }