summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-07-31 04:00:35 -0400
committerAdam <Adam@anope.org>2011-07-31 04:00:35 -0400
commitf32149117a0b32a26a7695760f29d1a2b10332c5 (patch)
treea7b31aaa2a059a69e8dbd013228c5af89cb7f7c2 /src/main.cpp
parent1cb11bba5dd36c2ac1f02e7b49c659de142ce481 (diff)
Fixed error message from being unable to connect
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 0c1db63ea..a33f1dff4 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -96,7 +96,15 @@ class ReconnectTimer : public Timer
void Tick(time_t)
{
- Connect();
+ try
+ {
+ Connect();
+ }
+ catch (const SocketException &ex)
+ {
+ quitmsg = ex.GetReason();
+ quitting = true;
+ }
}
};
@@ -343,13 +351,9 @@ int main(int ac, char **av, char **envp)
}
catch (const SocketException &ex)
{
- Log() << ex.GetReason();
- ModuleManager::UnloadAll();
- SocketEngine::Shutdown();
- for (Module *m; (m = ModuleManager::FindFirstOf(PROTOCOL)) != NULL;)
- ModuleManager::UnloadModule(m, NULL);
- ModuleManager::CleanupRuntimeDirectory();
- return -1;
+ quitmsg = ex.GetReason();
+ quitting = true;
+ return_code = -1;
}
started = true;
@@ -415,5 +419,5 @@ int main(int ac, char **av, char **envp)
return_code = -1;
}
- return 0;
+ return return_code;
}