private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
if (ois.readBoolean()) {
response = (ShellResponse)ois.readObject();
} else {
ErrorKind type = (ErrorKind)ois.readObject();
String message = (String)ois.readObject();
String errorMessage = (String)ois.readObject();
StackTraceElement[] errorTrace = (StackTraceElement[])ois.readObject();
Exception ex = new Exception(errorMessage);
ex.setStackTrace(errorTrace);