where do you declare class BadException ?
is this class and your code in the same folder?