Fix Exception catching
Merge pull request #1199 from psav/fix_check_pr

Fix Exception catching