Only add error message wrapper if there are error messages