Generating the Exception class NotConnectedException