Class CopilotWebSocketCloseStatus
java.lang.Object
com.github.copilot.CopilotWebSocketCloseStatus
The terminal status for a callback-owned WebSocket connection.
- Since:
- 1.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CopilotWebSocketCloseStatusA shared normal-closure (clean end-of-stream) instance. -
Constructor Summary
ConstructorsConstructorDescriptionCopilotWebSocketCloseStatus(String description, String errorCode, Throwable error) Creates a close status. -
Method Summary
Modifier and TypeMethodDescriptionGets the close description, if any.error()Gets the error that terminated the connection, if any.Gets the optional error code surfaced to the runtime when the close is a failure rather than a clean end-of-stream.
-
Field Details
-
NORMAL_CLOSURE
A shared normal-closure (clean end-of-stream) instance.
-
-
Constructor Details
-
CopilotWebSocketCloseStatus
Creates a close status.- Parameters:
description- the close description, ornullerrorCode- an optional machine-readable error code surfaced to the runtime when the close is a failure, ornullerror- the error that terminated the connection, ornullfor a clean close
-
-
Method Details
-
description
-
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
Gets the error that terminated the connection, if any.- Returns:
- the error, or
nullfor a clean close
-