Errors
- Added error handling for std::bad_alloc.
This commit is contained in:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user