All files / src/Ice OutgoingResponse.js

83.33% Statements 30/36
100% Branches 5/5
50% Functions 3/6
83.33% Lines 30/36

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 3741x 41x 41x 41x 41x 41x 41x 41x 957x 957x 957x 957x 957x 957x 957x 41x 41x 1272x 1272x 41x 41x 868x 868x 41x 41x     41x 41x     41x 41x     41x  
// Copyright (c) ZeroC, Inc.
 
import { Protocol } from "./Protocol.js";
import { Ice as Ice_ReplyStatus } from "./ReplyStatus.js";
const { ReplyStatus } = Ice_ReplyStatus;
 
export class OutgoingResponse {
    constructor(outputStream, replyStatus, exceptionId, exceptionDetails) {
        this._outputStream = outputStream;
        this._replyStatus = replyStatus || ReplyStatus.Ok;
        if (replyStatus !== ReplyStatus.Ok) {
            this._exceptionId = exceptionId;
            this._exceptionDetails = exceptionDetails;
        }
    }
 
    get replyStatus() {
        return this._replyStatus;
    }
 
    get outputStream() {
        return this._outputStream;
    }
 
    get exceptionId() {
        return this._exceptionId;
    }
 
    get exceptionDetails() {
        return this._exceptionDetails;
    }
 
    get size() {
        return this._outputStream.isEmpty ? 0 : this._outputStream.size - Protocol.headerSize - 4;
    }
}