added error reporting to main.cpp, added test for error reporting