err.message is undefined use err instead

such commit