mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Errors
- Added error handling for std::bad_alloc.
This commit is contained in:
parent
dffd4c0477
commit
489750c80a
1 changed files with 7 additions and 0 deletions
|
@ -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";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue