Handle exceptions on invalid query

* Added try/catch block and called done to nicely return exception to user.
Add tests

* Renamed exception name from e to err
* Added tests for invalid criteria
Removed unneeded newlines.
Replaced unneeded test with check for resultSet.
Merge pull request #15 from RWOverdijk/hotfix/crash-on-query

Handle exceptions on invalid query