Class ErrorInfo

  • All Implemented Interfaces:
    java.io.Serializable, scala.Equals, scala.Product

    public final class ErrorInfo
    extends java.lang.Object
    implements scala.Product, scala.Equals, java.io.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:
    Serialized Form
    • Constructor Detail

      • ErrorInfo

        public ErrorInfo​(java.lang.String summary,
                         java.lang.String detail,
                         java.lang.String errorHeaderName)
      • ErrorInfo

        public ErrorInfo​(java.lang.String summary,
                         java.lang.String detail)
        INTERNAL API
    • Method Detail

      • apply

        public static ErrorInfo apply​(java.lang.String summary,
                                      java.lang.String detail)
        INTERNAL API
      • unapply

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

        public static ErrorInfo fromCompoundString​(java.lang.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 java.lang.String summary()
      • detail

        public java.lang.String detail()
      • errorHeaderName

        public java.lang.String errorHeaderName()
      • withSummary

        public ErrorInfo withSummary​(java.lang.String newSummary)
      • withSummaryPrepended

        public ErrorInfo withSummaryPrepended​(java.lang.String prefix)
      • withErrorHeaderName

        public ErrorInfo withErrorHeaderName​(java.lang.String headerName)
      • withFallbackSummary

        public ErrorInfo withFallbackSummary​(java.lang.String fallbackSummary)
      • formatPretty

        public java.lang.String formatPretty()
      • format

        public java.lang.String format​(boolean withDetail)
      • copy

        public ErrorInfo copy​(java.lang.String summary,
                              java.lang.String detail)
        INTERNAL API
      • canEqual

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

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

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

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object