Adding curl error exception