Class XContentFormattedException

All Implemented Interfaces:
Serializable, Writeable, ChunkedToXContent, org.elasticsearch.xcontent.ToXContent, org.elasticsearch.xcontent.ToXContentFragment
Direct Known Subclasses:
UnifiedChatCompletionException

public class XContentFormattedException extends ElasticsearchException implements ChunkedToXContent
Similar to ElasticsearchWrapperException, this will wrap an Exception to generate an xContent using ElasticsearchException.generateFailureXContent(XContentBuilder, Params, Exception, boolean). Extends ElasticsearchException to provide REST handlers the status() method in order to set the response header.
See Also:
  • Field Details

  • Constructor Details

    • XContentFormattedException

      public XContentFormattedException(String message, RestStatus status)
    • XContentFormattedException

      public XContentFormattedException(Throwable cause, RestStatus status)
    • XContentFormattedException

      public XContentFormattedException(String message, Throwable cause, RestStatus status)
  • Method Details

    • status

      public RestStatus status()
      Overrides:
      status in class ElasticsearchException
    • toXContentChunked

      public Iterator<? extends org.elasticsearch.xcontent.ToXContent> toXContentChunked(org.elasticsearch.xcontent.ToXContent.Params params)
      Specified by:
      toXContentChunked in interface ChunkedToXContent
    • isFragment

      public boolean isFragment()
      Specified by:
      isFragment in interface ChunkedToXContent
      Specified by:
      isFragment in interface org.elasticsearch.xcontent.ToXContent
      Specified by:
      isFragment in interface org.elasticsearch.xcontent.ToXContentFragment