summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/inspircd.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index aaf20062f..4dc8cf03c 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -961,15 +961,22 @@ int main(int argc, char** argv)
try
{
- ServerInstance = new InspIRCd(argc, argv);
- ServerInstance->Run();
- DELETE(ServerInstance);
+ try
+ {
+ ServerInstance = new InspIRCd(argc, argv);
+ ServerInstance->Run();
+ DELETE(ServerInstance);
+ }
+ catch (std::bad_alloc)
+ {
+ log(SPARSE,"You are out of memory! (got exception std::bad_alloc!)");
+ ServerInstance->SendError("**** OUT OF MEMORY **** We're gonna need a bigger boat!");
+ }
}
- catch (std::bad_alloc)
+ catch (...)
{
- log(DEFAULT,"You are out of memory! (got exception std::bad_alloc!)");
- ServerInstance->SendError("**** OUT OF MEMORY **** We're gonna need a bigger boat!");
- printf("Out of memory! (got exception std::bad_alloc!");
+ log(SPARSE,"Uncaught exception, aborting.");
+ ServerInstance->SendError("Server terminating due to uncaught exception.");
}
return 0;
}