feature/docker #3

Merged
manuel merged 14 commits from feature/docker into master 2023-04-01 00:26:23 +02:00
Showing only changes of commit 305c26c215 - Show all commits

View file

@ -105,15 +105,15 @@ public class LabyrinthServer {
exchange.sendResponseHeaders(302, -1);
return;
}
final Labyrinth labyrinth = new Labyrinth(width, height, id);
final byte[] render;
try {
final Labyrinth labyrinth = new Labyrinth(width, height, id);
render = output.render(labyrinth);
} catch (Exception e) {
responseHeaders.add("Content-type", "text/plain; charset=UTF-8");
exchange.sendResponseHeaders(500, 0);
final OutputStream responseBody = exchange.getResponseBody();
responseBody.write(("Error: " + e).getBytes(StandardCharsets.UTF_8));
responseBody.write(("Error: " + e.getMessage()).getBytes(StandardCharsets.UTF_8));
responseBody.flush();
return;
}