I am trying to catch username password errors to show in the interface. But somehow I cannot catch the exeption. I wrap everything in a try except, but the exeption is still throwed and my app stops functioning. What am I doing wrong?
Koen loginInfo = ( self.username, self.password, store.server.address, store.server.port, store.tableName.replace(' ', '\ ')) engineURL = 'postgres://%s:[EMAIL PROTECTED]:%s/%s' % loginInfo """ try: engine = create_engine(engineURL) try: c = engine.connect() c.close() finally: d.dispose() except: self.showError(UserPasswordError) return False else: self.showError(None) """ # Make the actual connection here, we should improve this try: engine.connect(engineURL) result = engine.execute(text('SELECT NOW()')) except: engine.dispose() self.showError(UserPasswordError) return False --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---