Added exception class and unit tests for it