Trap AJAx errors.