Fix exception usage
Merge pull request #315 from romainneutron/fix-exception

Fix exception usage