Could you add a test for the raising exception part? Thanks!