Right now I just have a blank exception class. I was wondering how I can give it a variable when it gets raised and then retrieve that variable when I handle it in the try...exc
Give its constructor an argument, store that as an attribute, then retrieve it in the except clause:
except
class FooException(Exception): def __init__(self, foo): self.foo = foo try: raise FooException("Foo!") except FooException as e: print e.foo