当前位置: 首页>>代码示例>>Java>>正文


Java ExceptionsHelper.detailedMessage方法代码示例

本文整理汇总了Java中org.elasticsearch.ExceptionsHelper.detailedMessage方法的典型用法代码示例。如果您正苦于以下问题:Java ExceptionsHelper.detailedMessage方法的具体用法?Java ExceptionsHelper.detailedMessage怎么用?Java ExceptionsHelper.detailedMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.elasticsearch.ExceptionsHelper的用法示例。


在下文中一共展示了ExceptionsHelper.detailedMessage方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: toString

import org.elasticsearch.ExceptionsHelper; //导入方法依赖的package包/类
@Override
public String toString() {
    try {
        XContentBuilder builder = XContentFactory.jsonBuilder();
        builder.prettyPrint();
        toXContent(builder, EMPTY_PARAMS);
        return builder.string();
    } catch (Exception e) {
        return "{ \"error\" : \"" + ExceptionsHelper.detailedMessage(e) + "\"}";
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:12,代码来源:DirectCandidateGeneratorBuilder.java

示例2: getDetails

import org.elasticsearch.ExceptionsHelper; //导入方法依赖的package包/类
/**
 * Builds a string representation of the message and the failure if exists.
 */
@Nullable
public String getDetails() {
    if (message == null) {
        return null;
    }
    return message + (failure == null ? "" : ", failure " + ExceptionsHelper.detailedMessage(failure));
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:11,代码来源:UnassignedInfo.java

示例3: ShardSearchFailure

import org.elasticsearch.ExceptionsHelper; //导入方法依赖的package包/类
public ShardSearchFailure(Exception e, @Nullable SearchShardTarget shardTarget) {
    final Throwable actual = ExceptionsHelper.unwrapCause(e);
    if (actual != null && actual instanceof SearchException) {
        this.shardTarget = ((SearchException) actual).shard();
    } else if (shardTarget != null) {
        this.shardTarget = shardTarget;
    }
    status = ExceptionsHelper.status(actual);
    this.reason = ExceptionsHelper.detailedMessage(e);
    this.cause = actual;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:12,代码来源:ShardSearchFailure.java

示例4: toString

import org.elasticsearch.ExceptionsHelper; //导入方法依赖的package包/类
public final String toString(Params params) {
    try {
        XContentBuilder builder = XContentFactory.jsonBuilder();
        if (params.paramAsBoolean("pretty", true)) {
            builder.prettyPrint();
        }
        toXContent(builder, params);
        return builder.string();
    } catch (Exception e) {
        // So we have a stack trace logged somewhere
        return "{ \"error\" : \"" + ExceptionsHelper.detailedMessage(e) + "\"}";
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:14,代码来源:ToXContentToBytes.java

示例5: toString

import org.elasticsearch.ExceptionsHelper; //导入方法依赖的package包/类
@Override
public final String toString() {
    try {
        XContentBuilder builder = XContentFactory.jsonBuilder();
        builder.prettyPrint();
        toXContent(builder, EMPTY_PARAMS);
        return builder.string();
    } catch (Exception e) {
        return "{ \"error\" : \"" + ExceptionsHelper.detailedMessage(e) + "\"}";
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:12,代码来源:MoreLikeThisQueryBuilder.java

示例6: toString

import org.elasticsearch.ExceptionsHelper; //导入方法依赖的package包/类
@Override
public String toString() {
    if (sourceBuilder != null) {
        return sourceBuilder.toString();
    }
    if (request.source() != null) {
        try {
            return XContentHelper.convertToJson(request.source().toBytesArray(), false, true);
        } catch (Exception e) {
            return "{ \"error\" : \"" + ExceptionsHelper.detailedMessage(e) + "\"}";
        }
    }
    return new QuerySourceBuilder().toString();
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:15,代码来源:CountRequestBuilder.java

示例7: ShardSearchFailure

import org.elasticsearch.ExceptionsHelper; //导入方法依赖的package包/类
public ShardSearchFailure(Throwable t, @Nullable SearchShardTarget shardTarget) {
    Throwable actual = ExceptionsHelper.unwrapCause(t);
    if (actual != null && actual instanceof SearchException) {
        this.shardTarget = ((SearchException) actual).shard();
    } else if (shardTarget != null) {
        this.shardTarget = shardTarget;
    }
    status = ExceptionsHelper.status(actual);
    this.reason = ExceptionsHelper.detailedMessage(t);
    this.cause = actual;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:12,代码来源:ShardSearchFailure.java

示例8: toString

import org.elasticsearch.ExceptionsHelper; //导入方法依赖的package包/类
@Override
public String toString() {
    if (sourceBuilder != null) {
        return sourceBuilder.toString();
    }
    if (request.source() != null) {
        try {
            return XContentHelper.convertToJson(request.source().toBytesArray(), false, true);
        } catch (Exception e) {
            return "{ \"error\" : \"" + ExceptionsHelper.detailedMessage(e) + "\"}";
        }
    }
    return new SearchSourceBuilder().toString();
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:15,代码来源:SearchRequestBuilder.java

示例9: toString

import org.elasticsearch.ExceptionsHelper; //导入方法依赖的package包/类
@Override
public String toString() {
    return "failed shard, shard " + routingEntry + ", message [" + message + "], failure [" +
               ExceptionsHelper.detailedMessage(failure) + "]";
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:6,代码来源:FailedShard.java

示例10: reason

import org.elasticsearch.ExceptionsHelper; //导入方法依赖的package包/类
/**
 * @return A text description of the failure
 */
@Override
public String reason() {
    return ExceptionsHelper.detailedMessage(cause);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:ReplicationResponse.java

示例11: toString

import org.elasticsearch.ExceptionsHelper; //导入方法依赖的package包/类
@Override
public String toString() {
    return "node[" + finderNodeId + "] find afailed shard, shard " + shard + ", message [" + message + "], failure [" + ExceptionsHelper.detailedMessage(failure) + "]";
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:5,代码来源:FailedRerouteAllocation.java


注:本文中的org.elasticsearch.ExceptionsHelper.detailedMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。