wrapped curl.perform() in try block