Revert "Implemented more flexible and "Flask"-aligned way of managing custom error handler"

This reverts commit 49c04e124a46a0ac9579ccad1342eb2ff6c88b55.