user defined exception handling in python