@Override
	public void execute(String commandName, BufferedReader reader, BufferedWriter writer)
			throws Py4JException, IOException {
		String returnCommand = null;
		Throwable exception = (Throwable) Protocol.getObject(reader.readLine(), this.gateway);
		// EOQ
		reader.readLine();

		String stackTrace = Protocol.getThrowableAsString(exception);
		ReturnObject rObject = ReturnObject.getPrimitiveReturnObject(stackTrace);
		returnCommand = Protocol.getOutputCommand(rObject);

		logger.finest("Returning command: " + returnCommand);
		writer.write(returnCommand);
		writer.flush();
	}
@Test
	public void testException() {
		String id = null;
		try {
			throw new RuntimeException("Hello World");
		} catch (Exception e) {
			id = "r" + gateway.putNewObject(e);
		}

		String inputCommand = id + "\ne\n";
		try {
			command.execute("p", new BufferedReader(new StringReader(inputCommand)), writer);
			System.out.println("DEBUG!!!" + sWriter.toString());
			assertTrue(sWriter.toString().startsWith("!ysjava.lang.RuntimeException: Hello World"));
		} catch (Exception e) {
			e.printStackTrace();
			fail();
		}
	}