Modifying the captured exception to fit the appropiate one