Revert "Merge pull request #859 from wvh/register_error_handler"

This reverts commit 6347e75deea2eda444c60080fda3885c1fb7705d, reversing
changes made to 3fd40e83e5df4dbde8531a76c42d26bf76674e95.