50 std::runtime_error(
"Object build error"),
errors_(errors)
58 virtual const char*
what()
const throw()
60 std::ostringstream msg(
"");
62 msg << runtime_error::what() <<
": "
63 <<
"See errors for details.";
65 return strdup(msg.str().c_str());
85 if(isatty(fileno(stdout)))
87 std::cout << std::setw(msgw + 8) << std::left <<
"\033[1m" + notice +
"\033[0m";
91 std::cout << std::setw(msgw + 8) << std::left << notice;
105 if(isatty(fileno(stdout)))
107 std::cout << std::setw(notw) << std::right <<
"\033[1;31mError(s)! See below.\033[0m\n";
111 std::cout << std::setw(notw) << std::right <<
"Error(s)! See below.\n";
113 for(
auto& msg : msgs)
114 std::cout <<
" * " << msg <<
"\n";
126 if(isatty(fileno(stdout)))
128 std::cout << std::setw(notw) << std::right <<
"\033[32mOK!\033[0m\n";
132 std::cout << std::setw(notw) << std::right <<
"OK!\n";
137 for(
auto& msg : msgs)
138 std::cout << prefix <<
" * " << msg <<
"\n";
Exception to be thrown when building the Driver fails.
std::vector< std::string > GetErrors()
Get specific error message.
std::vector< std::string > errors_
Error message.
virtual const char * what() const
Get generic error message.
BuildException(std::vector< std::string > errors)
Constructor.
void PrintBoldNotice(const std::string ¬ice, int msgw)
Print out Notice in bold text.
void DumpNoticesToConsole(const std::vector< std::string > &msgs, std::string prefix, int notw)
Print a list of notices.
int DumpErrorsToConsole(const std::vector< std::string > &msgs, int notw)
Print a list of errors.