Prevent undefined error stack

If for some reason we do not get an error passed to this method ensure
that we cast it to an error