- Added error handling for std::bad_alloc.
This commit is contained in:
Paul Beckingham 2014-10-09 18:09:38 -04:00
parent dffd4c0477
commit 489750c80a

View file

@ -26,6 +26,7 @@
#include <cmake.h>
#include <iostream>
#include <new>
#include <cstring>
#include <i18n.h>
#include <Context.h>
@ -57,6 +58,12 @@ int main (int argc, const char** argv)
status = -1;
}
catch (std::bad_alloc& error)
{
std::cerr << "Error: Memory allocation failed: " << error.what () << "\n";
status = -3;
}
catch (...)
{
std::cerr << STRING_UNKNOWN_ERROR << "\n";