mirror of
https://github.com/Syncplay/syncplay
synced 2025-02-09 23:46:58 +00:00
[irc] print traceback on exceptions
This commit is contained in:
parent
76186bc17b
commit
ac02d581b7
@ -6,6 +6,7 @@ import socket
|
|||||||
import threading
|
import threading
|
||||||
from syncplay import utils
|
from syncplay import utils
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
import traceback
|
||||||
|
|
||||||
class Bot(object):
|
class Bot(object):
|
||||||
def __init__(self, server='irc.rizon.net', serverPassword='', port=6667, nick='SyncBot', nickservPass='', channel='', channelPassword='', functions=[]):
|
def __init__(self, server='irc.rizon.net', serverPassword='', port=6667, nick='SyncBot', nickservPass='', channel='', channelPassword='', functions=[]):
|
||||||
@ -172,6 +173,7 @@ def handlingThread(sock, bot):
|
|||||||
while bot.active:
|
while bot.active:
|
||||||
rcvd = sock.recv(4096).split('\n')
|
rcvd = sock.recv(4096).split('\n')
|
||||||
for line in rcvd:
|
for line in rcvd:
|
||||||
|
try:
|
||||||
line = line.replace('\r', '')
|
line = line.replace('\r', '')
|
||||||
|
|
||||||
if line.split(' ')[0] == 'PING':
|
if line.split(' ')[0] == 'PING':
|
||||||
@ -205,3 +207,5 @@ def handlingThread(sock, bot):
|
|||||||
msg = msg[:-1].lstrip()
|
msg = msg[:-1].lstrip()
|
||||||
# ---END WTF BLOCK- --
|
# ---END WTF BLOCK- --
|
||||||
bot.irc_onMsg(nfrom, addrnfrom, to, msg)
|
bot.irc_onMsg(nfrom, addrnfrom, to, msg)
|
||||||
|
except:
|
||||||
|
print traceback.format_exc()
|
Loading…
Reference in New Issue
Block a user