Permalink
Browse files

Move more exceptions into lib, catch config errors

  • Loading branch information...
richo committed Sep 28, 2011
1 parent 8953d70 commit 365e88519bce4f3396db3af75b45636074de64b9
Showing with 12 additions and 8 deletions.
  1. +1 −4 config.py
  2. +1 −1 ircSocket.py
  3. +4 −0 lib.py
  4. +6 −3 pyBawt.py
View
@@ -8,11 +8,8 @@
import logging
import os
+from lib import *
-class InvalidConfig(Exception):
- pass
-class NoConfigFile(Exception):
- pass
CONFIG_FILE = 'pyBawt.conf'
View
@@ -1,3 +1,4 @@
+from lib import *
import threading
import socket
import sys
@@ -13,7 +14,6 @@
import auth
import logging
-from lib import *
def should_reconnect():
"""This hook lies in here because it'll give the rest of the structure a fairly central place
View
4 lib.py
@@ -42,3 +42,7 @@ class StopHandling(Exception):
class ModuleAlreadyLoaded(Exception):
pass
+class InvalidConfig(Exception):
+ pass
+class NoConfigFile(Exception):
+ pass
View
@@ -11,18 +11,21 @@
##
# Rich Healey '08
+from lib import *
+import logging
+try:
+ import config
+except InvalidConfig:
+ logging.fatal("Couldn't load config file")
import ircSocket
import time
import sys
import os
import random
-import config
import bModules
-import logging
import traceback
-from lib import *
logging.info("pyBawt started")

0 comments on commit 365e885

Please sign in to comment.