public static CloseWebSocketFrame newCloseWebSocketFrame(Throwable cause) {
        final WebSocketCloseStatus closeStatus;
        if (cause instanceof WebSocketProtocolViolationException) {
            closeStatus = ((WebSocketProtocolViolationException) cause).closeStatus();
        } else {
            closeStatus = WebSocketCloseStatus.INTERNAL_SERVER_ERROR;
        }
        // If the length of the phrase exceeds 125 characters, it is truncated to satisfy the
        // <a href="https://datatracker.ietf.org/doc/html/rfc6455#section-5.5">specification</a>.
        String reasonPhrase = maybeTruncate(cause.getMessage());
        if (reasonPhrase == null) {
            reasonPhrase = closeStatus.reasonPhrase();
        }
        return WebSocketFrame.ofClose(closeStatus, reasonPhrase);
    }
Generates Sec-WebSocket-Accept using Sec-WebSocket-Key.

@see <a href="https://datatracker.ietf.org/doc/html/rfc6455#section-1.3">Opening Handshake</a>
core/src/main/java/com/linecorp/armeria/internal/common/websocket/WebSocketUtil.java