add spec for handling the exceptions