Errors
- Added error handling for std::bad_alloc.
This commit is contained in:
@@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
#include <cmake.h>
|
#include <cmake.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <new>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <i18n.h>
|
#include <i18n.h>
|
||||||
#include <Context.h>
|
#include <Context.h>
|
||||||
@@ -57,6 +58,12 @@ int main (int argc, const char** argv)
|
|||||||
status = -1;
|
status = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
catch (std::bad_alloc& error)
|
||||||
|
{
|
||||||
|
std::cerr << "Error: Memory allocation failed: " << error.what () << "\n";
|
||||||
|
status = -3;
|
||||||
|
}
|
||||||
|
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
std::cerr << STRING_UNKNOWN_ERROR << "\n";
|
std::cerr << STRING_UNKNOWN_ERROR << "\n";
|
||||||
|
|||||||
Reference in New Issue
Block a user