void (SocketChannel socketChannel) { try (socketChannel) { var request = readLines(socketChannel); CliResult result; try { result = myProcessor.apply(request); } catch (Throwable t) { LOG.error(t); var error = requireNonNullElse(t.getMessage(), "Unknown error"); var message = BootstrapBundle.message("bootstrap.error.request.failed", myPid, t.getClass(), error, LoggerFactory.getLogFilePath()); result = new CliResult(AppExitCodes.ACTIVATE_ERROR, message); } sendLines(socketChannel, List.of(String.valueOf(result.exitCode()), requireNonNullElse(result.message(), ""))); } catch (IOException e) { LOG.warn(e); } }