catch curl errors