use exceptions

This commit is contained in:
Christine Dodrill 2015-06-13 07:51:56 -07:00
parent 364e3d90f1
commit d84158f627
1 changed files with 8 additions and 1 deletions

View File

@ -20,6 +20,13 @@ if admin:
echo "hostname: ", hostname
echo "port: ", optPort
var conn = redis.open(hostname, optPort.Port)
var conn: redis.Redis
try:
conn = redis.open(hostname, optPort.Port)
except:
echo "Could not connect to redis: " & getCurrentExceptionMsg()
quit()
conn.quit()