added unit tests for error reporting