class E(Exception): 
   def __init__(self, msg):
      Exception.__init__(self,msg)
try:
   raise E("mi mensaje de error")
except E, obj:
   print 'Msg:', obj.message
