All pastes #763929 Raw Edit

Miscellany

public python v1 · immutable
·published 2007-11-06 21:02 UTC
rendered paste body
import exceptionsclass UserError(exceptions.Exception):    def __init__(self, args=None):        self.args = argsdef bar():    raise UserError, "test error message"def foo():    try:        u = bar()    except UserError, e:        print e        return>>> foo()('t', 'e', 's', 't', ' ', 'e', 'r', 'r', 'o', 'r', ' ', 'm', 'e', 's', 's', 'a', 'g', 'e')