Fixed issues #45 and added a supporting unit test

Fixed issue #45 and added a supporting unit test
@krmahadevan I was just following the pattern that was already in that test file. I'm fine with doing this either way. I think the try/catch block was put it to nicely capture an error message instead of throwing a whole stack trace in the logs