public void setStreamError(int code, String message) {

        // Map status code to GuacamoleStatus, assuming SERVER_ERROR by default
        GuacamoleStatus status = GuacamoleStatus.fromGuacamoleStatusCode(code);
        if (status == null)
            status = GuacamoleStatus.SERVER_ERROR;

        // Associate stream with corresponding GuacamoleStreamException
        setStreamError(new GuacamoleStreamException(status, message));

    }
Reports that this InterceptedStream did not complete successfully due to
an error described by the given status code and human-readable message.
The error reported by this call can later be retrieved as a
GuacamoleStreamException by calling getStreamError().

@param code
    The Guacamole protocol status code which described the error that
    occurred. This should be taken directly from the "ack" instruction
    that reported the error witin the intercepted stream.

@param message
    A human-readable message describing the error that occurred. This
    should be taken directly from the "ack" instruction that reported
    the error witin the intercepted stream.
guacamole/src/main/java/org/apache/guacamole/tunnel/InterceptedStream.java