Fix hard crash during exception catch

When an uncaughtException is fired, sometimes there may be no error or no error.stack property, this causes a harder crash.
This patch fixes this in hope that if there is no stack, maybe err.toString() will be at least a little useful.

falls back to "<undefined>" if there is no error at all.