Exception and constructor class