added ErrorReporter class for uniform error reporting