Changeset 5955

Show
Ignore:
Timestamp:
08/09/2010 08:39:55 AM (2 years ago)
Author:
ed
Message:

Fixed a poor attempt at handling unicode in error notifications. Part of #1365.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dabo/ui/uiwx/dForm.py

    r5918 r5955  
    400400            return True 
    401401             
    402         except dException.BusinessRuleViolation, e: 
     402        except (dException.BusinessRuleViolation, dException.DBQueryException), e: 
    403403            self.setStatusText(_("Save failed.")) 
    404             msg = "%s:\n\n%s" % (_("Save Failed"), self.Application.str2Unicode(e)) 
    405             self.notifyUser(msg, severe=True, exception=e) 
    406             return False 
    407  
    408         except dException.DBQueryException, e: 
    409             self.setStatusText(_("Save failed.")) 
    410             msg = "%s:\n\n%s" % (_("Save Failed"), e) 
     404            txt = _("Save Failed") 
     405            msg = "%(txt)s:\n\n%(e)s" % locals() 
    411406            self.notifyUser(msg, severe=True, exception=e) 
    412407            return False