You can attach state information and methods to your own exception.
They can customize their error message text displayed if they're not caught:
class Career(Exception): def __str__(self): return 'So I became a waiter...' raise Career()# from w w w . j a v a 2 s .com