def _on_error(self, err):
        """Called when recevied error message from server.
        Create error_dlg from GUI.errordlg with error message.

        :param err: error
        """
        error_dlg(err.getErrorMessage()[1:-1])               
    def _on_login_error(self, err):
        """Called when recevied error message from server when user login.
        Create error_dlg from GUI.errordlg with error message.
        Show again login dialog.

        :param err: error
        """
        error_dlg(err.getErrorMessage())        
 def clientConnectionLost(self, connector, reason):
     """Overrides twisted.internet.protocol.ClientFactory.clientConnectionFailed.
     Create error_dlg from GUI.errordlg with the reason why connection
     was lost if it's not close clearly.
     """
     if not reason.check(ConnectionDone):
         error_dlg('Connection Lost:\n%s' % reason.getErrorMessage())
     else:
         reactor.stop()
 def clientConnectionFailed(self, connector, reason):
     """Overrides twisted.internet.protocol.ClientFactory.clientConnectionFailed.
     Create error_dlg from GUI.errordlg with the reason why connection
     was failed
     """
     error_dlg('Connection Faild:\n%s' % reason.getErrorMessage())        
 def on_login_error(self, err):
     error_dlg(err.getErrorMessage())
     self.login_gui.ShowModal()
 def on_error(self, err):
     error_dlg(err.getErrorMessage())
 def clientConnectionLost(self, connector, reason):
     error_dlg("Connection Lost:\n%s" % reason.getErrorMessage())
 def clientConnectionFailed(self, connector, reason):
     error_dlg("Connection Faild:\n%s" % reason.getErrorMessage())