test: add tests for throwing custom errors
Merge pull request #202 from andreineculau/patch-2

test: add tests for throwing custom errors