Class ErrorInfo

java.lang.Object
akka.http.scaladsl.model.ErrorInfo
All Implemented Interfaces:
Serializable, scala.Equals, scala.Product

public final class ErrorInfo extends Object implements scala.Product, scala.Equals, Serializable
Two-level model of error information. The summary should explain what is wrong with the request or response *without* directly repeating anything present in the message itself (in order to not open holes for XSS attacks), while the detail can contain additional information from any source (even the request itself).
See Also:
  • Constructor Details

    • ErrorInfo

      public ErrorInfo(String summary, String detail, String errorHeaderName)
    • ErrorInfo

      public ErrorInfo(String summary, String detail)
      INTERNAL API
  • Method Details

    • apply

      public static ErrorInfo apply(String summary, String detail)
      INTERNAL API
    • unapply

      public static scala.Option<scala.Tuple2<String,String>> unapply(ErrorInfo arg)
    • fromCompoundString

      public static ErrorInfo fromCompoundString(String message)
      Allows constructing an ErrorInfo from a single string. Used for example when catching exceptions generated by the header value parser, which doesn't provide summary/details information but structures its exception messages accordingly.
      Parameters:
      message - (undocumented)
      Returns:
      (undocumented)
    • summary

      public String summary()
    • detail

      public String detail()
    • errorHeaderName

      public String errorHeaderName()
    • withSummary

      public ErrorInfo withSummary(String newSummary)
    • withSummaryPrepended

      public ErrorInfo withSummaryPrepended(String prefix)
    • withErrorHeaderName

      public ErrorInfo withErrorHeaderName(String headerName)
    • withFallbackSummary

      public ErrorInfo withFallbackSummary(String fallbackSummary)
    • formatPretty

      public String formatPretty()
    • format

      public String format(boolean withDetail)
    • copy

      public ErrorInfo copy(String summary, String detail)
      INTERNAL API
    • canEqual

      public boolean canEqual(Object that)
      Specified by:
      canEqual in interface scala.Equals
    • equals

      public boolean equals(Object that)
      Specified by:
      equals in interface scala.Equals
      Overrides:
      equals in class Object
    • productElement

      public Object productElement(int n)
      Specified by:
      productElement in interface scala.Product
    • productArity

      public int productArity()
      Specified by:
      productArity in interface scala.Product
    • toString

      public String toString()
      Overrides:
      toString in class Object