Class ErrorInfo


  • public class ErrorInfo
    extends java.lang.Object
    An exception type encapsulating error information containing an Ably-specific error code and generic status code.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      int code
      Ably error code (see ably-common/protocol/errors.json)
      java.lang.String href
      Link to specification detail for this error code, where available.
      java.lang.String message
      Additional message information, where available
      int statusCode
      HTTP Status Code corresponding to this error, where applicable
    • Constructor Summary

      Constructors 
      Constructor Description
      ErrorInfo()
      Public no-argument constructor for msgpack
      ErrorInfo​(java.lang.String message, int code)
      Construct an ErrorInfo from message and code
      ErrorInfo​(java.lang.String message, int statusCode, int code)
      Generic constructor
    • Field Detail

      • code

        public int code
        Ably error code (see ably-common/protocol/errors.json)
      • statusCode

        public int statusCode
        HTTP Status Code corresponding to this error, where applicable
      • message

        public java.lang.String message
        Additional message information, where available
      • href

        public java.lang.String href
        Link to specification detail for this error code, where available. Spec TI4.
    • Constructor Detail

      • ErrorInfo

        public ErrorInfo()
        Public no-argument constructor for msgpack
      • ErrorInfo

        public ErrorInfo​(java.lang.String message,
                         int code)
        Construct an ErrorInfo from message and code
        Parameters:
        message -
        code -
      • ErrorInfo

        public ErrorInfo​(java.lang.String message,
                         int statusCode,
                         int code)
        Generic constructor
        Parameters:
        message -
        statusCode -
        code -
    • Method Detail

      • toString

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

        public static ErrorInfo fromMsgpackBody​(byte[] msgpack)
                                         throws java.io.IOException
        Throws:
        java.io.IOException
      • fromThrowable

        public static ErrorInfo fromThrowable​(java.lang.Throwable throwable)
      • fromResponseStatus

        public static ErrorInfo fromResponseStatus​(java.lang.String statusLine,
                                                   int statusCode)
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object