unit tests for error handler