This may be a fairly excetional case but I need to be able to handle it without my app crashing.
I am trying to connect to a specified database (which does exist) but the default database for the login user is set to one that does not exist (as a result of an incomplete dump and load). On trying to connect, the python-sybase module returns multiple DatabaseError exceptions (error 911, error 4001) but my try....except block only catches the first and any subsequent exceptions cause the app to crash.
The only way I have been able to hack around this is to stop Sybase._servermsg_cb raising exceptions for errors 911 & 4001. The module raises an additional exception: 'cannot release un-aquired lock' which is the one I then catch and log/display an appropriate message.
I obviously don't like having to hack the module source code (though it's nice that I can).
Anyone know of any other way around this problem (I would be surprised if no-one else has encounterd it but I've found nothing via internet searches)