Class CopilotWebSocketCloseStatus

java.lang.Object
com.github.copilot.CopilotWebSocketCloseStatus

public final class CopilotWebSocketCloseStatus extends Object
The terminal status for a callback-owned WebSocket connection.
Since:
1.0.0
  • Field Details

    • NORMAL_CLOSURE

      public static final CopilotWebSocketCloseStatus NORMAL_CLOSURE
      A shared normal-closure (clean end-of-stream) instance.
  • Constructor Details

    • CopilotWebSocketCloseStatus

      public CopilotWebSocketCloseStatus(String description, String errorCode, Throwable error)
      Creates a close status.
      Parameters:
      description - the close description, or null
      errorCode - an optional machine-readable error code surfaced to the runtime when the close is a failure, or null
      error - the error that terminated the connection, or null for a clean close
  • Method Details

    • description

      public String description()
      Gets the close description, if any.
      Returns:
      the description, or null
    • errorCode

      public String errorCode()
      Gets the optional error code surfaced to the runtime when the close is a failure rather than a clean end-of-stream.
      Returns:
      the error code, or null
    • error

      public Throwable error()
      Gets the error that terminated the connection, if any.
      Returns:
      the error, or null for a clean close