Added exception logging.

Also need to output the exception message, code, file and line number .... aaaaand the previous exceptions.