fixing handler unit tests for the error method