Handle curl exception