Added code for nested exceptions

This is catering for errors that have nested inner exceptions where
usually the real detail of the problem lies. This iterates through the
nested exceptions, up to 10 in depth.
Added stack information also

For exceptions that contained nested exceptions this will pull out this
information for the message exception and the stack trace up to 10
exceptions deep.