當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。