public static ErrorFrame sendError()

in tchannel-core/src/main/java/com/uber/tchannel/frames/ErrorFrame.java [134:157]


    public static ErrorFrame sendError(ErrorType type,
                                       String message,
                                       Request request,
                                       ChannelHandlerContext ctx) {
        try {
            ErrorFrame errorFrame = new ErrorFrame(
                request.getId(),
                type,
                // TODO: get trace from request
                new Trace(0, 0, 0, (byte) 0x00),
                message
            );

            MessageCodec.write(ctx, errorFrame);
            return errorFrame;
        } finally {
            try {
                request.releaseQuietly();
            } catch (RuntimeException ex) {
                //no op
                //double release doesn't cause mem-leaks or other side effects, just ignore
            }
        }
    }