aboutsummaryrefslogtreecommitdiffstats
path: root/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/ErrorHttpResponse.java
blob: a12cd1ec08995cd83e8f86ad3c43f1ef390ceb52 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.http.server;

import com.yahoo.container.jdisc.HttpResponse;
import com.yahoo.text.Utf8;

import java.io.IOException;
import java.io.OutputStream;

public class ErrorHttpResponse extends HttpResponse {

    private final String msg;

    public ErrorHttpResponse(final int statusCode, final String msg) {
        super(statusCode);
        this.msg = msg;
    }

    @Override
    public void render(OutputStream outputStream) throws IOException {
        outputStream.write(Utf8.toBytes(msg));
    }

}