Custom exception class and some exception testing.