本文整理汇总了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) + "]";
}