#! /usr/bin/env python class BottleException(Exception): def __init__(self, i, c): self.cause = c self.cnt = i try: a = 1/(99-i) raise BottleException(i+1, self) except ZeroDivisionError: pass def getCause(self): return self.cause