blob: dd61f092d24f2ef067827e84ea6d98e8864a0597 (
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 Vespa.ai. 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));
}
}
|