Added simple error handling

This pull request implements some very simple, basic error handling. If the query somehow fails, the getMsg() from the Exception is shown to the user.