replace deprecated error handling

resolves #50
Merge pull request #70 from dduugg/feature/50

replace deprecated error handling