Undefined check added for err no and err code

Hello again

I just had a case today where an error email with undefined err no and code was sent to me.
So I updated the if () block with typeof undefined checks, see commit.

Hope you can merge that into your repo?

Grazie!
Michael