handle GrumbleErrors in a nicer way
parent
0d9ad8ee47
commit
3a82d3281b
3
bot.py
3
bot.py
|
@ -9,6 +9,7 @@ http://inamidst.com/phenny/
|
||||||
|
|
||||||
import sys, os, re, threading, imp
|
import sys, os, re, threading, imp
|
||||||
import irc
|
import irc
|
||||||
|
import tools
|
||||||
|
|
||||||
home = os.getcwd()
|
home = os.getcwd()
|
||||||
|
|
||||||
|
@ -194,6 +195,8 @@ class Phenny(irc.Bot):
|
||||||
|
|
||||||
def call(self, func, origin, phenny, input):
|
def call(self, func, origin, phenny, input):
|
||||||
try: func(phenny, input)
|
try: func(phenny, input)
|
||||||
|
except tools.GrumbleError as e:
|
||||||
|
self.msg(origin.sender, str(e))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.error(origin)
|
self.error(origin)
|
||||||
|
|
||||||
|
|
1
phenny
1
phenny
|
@ -126,7 +126,6 @@ def main(argv=None):
|
||||||
parser.add_argument('-c', '--config', metavar='fn',
|
parser.add_argument('-c', '--config', metavar='fn',
|
||||||
help='use this configuration file or directory')
|
help='use this configuration file or directory')
|
||||||
args = parser.parse_args(argv)
|
args = parser.parse_args(argv)
|
||||||
#if args: print('Warning: ignoring spurious arguments', file=sys.stderr)
|
|
||||||
|
|
||||||
# Step Two: Check Dependencies
|
# Step Two: Check Dependencies
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue