try to catch exception from httplib.