fix error throwing logic
Merge pull request #1 from bioball/master

fix error throwing logic