Revert "1. reorganized error handler to be a class method"

This reverts commit 8fad3b6470f7164ad71b6c5d534affd0293f70d4.