if (previous != null) {
if (previous instanceof RuntimeException)
throw (RuntimeException) previous;
else
throw new ODatabaseException("Generic error, see the underlying cause", previous);
} else
throw new ONetworkProtocolException("Network response error: " + buffer.toString());
} else {
// PROTOCOL ERROR