TIMOB-12510: Provide better exception reporting.

This fixes errors in reporting the location of exceptions and also adds stack trace dumps.
See the JIRA ticket for acceptance testing details.