mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +01:00
Fixed to catch our SOAPpy errors.
This commit is contained in:
parent
e360856ac3
commit
567cd195d3
@ -44,7 +44,7 @@ import socket
|
|||||||
import urllib
|
import urllib
|
||||||
import xml.sax
|
import xml.sax
|
||||||
|
|
||||||
import SOAP
|
import SOAPpy
|
||||||
import google
|
import google
|
||||||
|
|
||||||
import supybot.registry as registry
|
import supybot.registry as registry
|
||||||
@ -116,17 +116,18 @@ def search(log, queries, **kwargs):
|
|||||||
raise callbacks.Error, 'Connection timed out to Google.com.'
|
raise callbacks.Error, 'Connection timed out to Google.com.'
|
||||||
else:
|
else:
|
||||||
raise callbacks.Error, 'Error connecting to Google.com.'
|
raise callbacks.Error, 'Error connecting to Google.com.'
|
||||||
except SOAP.HTTPError, e:
|
except SOAPpy.HTTPError, e:
|
||||||
log.info('HTTP Error accessing Google: %s', e)
|
log.info('HTTP Error accessing Google: %s', e)
|
||||||
raise callbacks.Error, 'Error connecting to Google.com.'
|
raise callbacks.Error, 'Error connecting to Google.com.'
|
||||||
except SOAP.faultType, e:
|
except SOAPpy.faultType, e:
|
||||||
log.exception('Uncaught SOAP error:')
|
if 'Invalid authorization key' not in e.faultstring:
|
||||||
|
log.exception('Unexpected SOAPpy error:')
|
||||||
raise callbacks.Error, 'Invalid Google license key.'
|
raise callbacks.Error, 'Invalid Google license key.'
|
||||||
except xml.sax.SAXException, e:
|
except xml.sax.SAXException, e:
|
||||||
log.exception('Uncaught SAX error:')
|
log.exception('Uncaught SAX error:')
|
||||||
raise callbacks.Error, 'Google returned an unparsable response. ' \
|
raise callbacks.Error, 'Google returned an unparsable response. ' \
|
||||||
'The full traceback has been logged.'
|
'The full traceback has been logged.'
|
||||||
except SOAP.Error, e:
|
except SOAPpy.Error, e:
|
||||||
log.exception('Uncaught SOAP exception in Google.search:')
|
log.exception('Uncaught SOAP exception in Google.search:')
|
||||||
raise callbacks.Error, 'Error connecting to Google.com.'
|
raise callbacks.Error, 'Error connecting to Google.com.'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user