Print stack on error events

Error stacks are never written to file. Need to get the stack/message from the error object before writing to file.

Feedback is appreciated! 
Aha, didnt know that. Thanks.

I can make a new object and push that to file. Is that a more suitable solution?