- Code: Select all
import urllib2
from urllib2 import URLError
from sys import exit
#location of temp alert file
url = "http://10.0.1.99/xmlfeed.rb"
try:
response = urllib2.urlopen(url)
except URLError, e:
print 'error: script had a URL error'
#if there is an error exit script
exit(0)
When run in Indigo and there is no error it runs fine but when there is an error I get this error in the log;
2013-01-19 1:13:06 PM
Script Error Error in plugin execution executeFile:
Traceback (most recent call last):
File "plugin.py", line 216, in executeFile
File "plugin.py", line 184, in _compileExecuteSource
File "<string>", line 23, in _dynamicFunc
<type 'exceptions.SystemExit'>: 0