fix lint errors
add test of error handler
test: simplify