improved mining curl error handeling