Revert "Move error handling method into separate file"

This reverts commit 90c761eecc56a87a3520829ea180ec5d27bf92a4.
Revert "Merge pull request #92 from roykolak/history-query-refactor"

This reverts commit dfa225b9c7441a84927204593974164388243fd7, reversing
changes made to 4c7fdd7c17b73ade6171c73b298d1a511b983088.