Throwing exception for unknown exception type