ExceptionResponse exceptionResponse = (ExceptionResponse) response;
Throwable exception = exceptionResponse.getException();
log.warn("Failed to create connection: " + exception, exception);
Error error = new Error();
result.setError(error);
StringWriter buffer = new StringWriter();
exception.printStackTrace(new PrintWriter(buffer));
error.setInternalServerError(buffer.toString());
}
else {
connected.set(true);
}
transport.marshall(result);