本文整理匯總了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) + "\"}";
}
}
示例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));
}
示例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;
}
示例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) + "\"}";
}
}
示例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) + "\"}";
}
}
示例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();
}
示例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;
}
示例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();
}
示例9: toString
import org.elasticsearch.ExceptionsHelper; //導入方法依賴的package包/類
@Override
public String toString() {
return "failed shard, shard " + routingEntry + ", message [" + message + "], failure [" +
ExceptionsHelper.detailedMessage(failure) + "]";
}
示例10: reason
import org.elasticsearch.ExceptionsHelper; //導入方法依賴的package包/類
/**
* @return A text description of the failure
*/
@Override
public String reason() {
return ExceptionsHelper.detailedMessage(cause);
}
示例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) + "]";
}