Class ErrorInfo

java.lang.Object
io.ably.lib.types.ErrorInfo

public class ErrorInfo
extends java.lang.Object
A generic Ably error object that contains an Ably-specific status code, and a generic status code. Errors returned from the Ably server are compatible with the ErrorInfo structure and should result in errors that inherit from ErrorInfo.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    int code
    java.lang.String href
    This is included for REST responses to provide a URL for additional help on the error code.
    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)
    Construct an ErrorInfo from message, statusCode, and code
  • Method Summary

    Modifier and Type Method Description
    boolean equals​(java.lang.Object o)  
    static ErrorInfo fromMsgpackBody​(byte[] msgpack)  
    static ErrorInfo fromResponseStatus​(java.lang.String statusLine, int statusCode)  
    static ErrorInfo fromThrowable​(java.lang.Throwable throwable)  
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • code

      public int code
      Ably error code.

      Spec: TI1

    • statusCode

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

      Spec: TI1

    • message

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

      Spec: TI1

    • href

      public java.lang.String href
      This is included for REST responses to provide a URL for additional help on the error code.

      Spec: TI4

  • Constructor Details

    • 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 - Additional message information, where available.
      code - Ably error code.
    • ErrorInfo

      public ErrorInfo​(java.lang.String message, int statusCode, int code)
      Construct an ErrorInfo from message, statusCode, and code
      Parameters:
      message - Additional message information, where available.
      statusCode - HTTP Status Code corresponding to this error, where applicable.
      code - Ably error code.
  • Method Details

    • 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