Find all the residue of $f(z)= e^z\csc^2(z)$ at all its pole in the finite plane.

My attempt- $z=n\pi, n \in \mathbb{Z}$ are the set of poles, each of order 2. Therefore residue will be $$\operatorname{Res}(z=n\pi)= \lim\_{z\to n\pi}\frac{1}{1!}\frac{d}{dz} \frac{(z-n\pi)^2 e^z}{\sin^2(z)} $$ $$= \lim\_{z\to n\pi}\frac{2\sin^2(z)(z-n\pi)e^z+ \sin^2(z)(z-n\pi)^2e^z- 2(z-n\pi)^2e^z\sin(z)\cos(z)}{\sin^4(z)}$$ $$=\lim\_{z\to n\pi}\frac{2e^{n\pi}}{\sin(z)} + e^{n\pi} - \lim\_{z\to n\pi}\frac{2e^{n\pi}\cos(z)}{\sin(z)} $$ $$=\begin{cases} e^{2m\pi}, z=2m, m\in \mathbb{Z} \\ \infty , z=2m+1, m\in \mathbb{Z}\end{cases}$$

I believe this result is wrong for odd integers as otherwise pole of order 2 has no meaning if residue is infinite.