It is somewhat disappointing that NIntegrate does not decide at once that the integral diverges.
NIntegrate
int = Integrate[Cos[x]/(x + e), {x, 0, \[Infinity]}, Assumptions -> e >= 0] Limit[int, e -> 0] (* \[Infinity] *)