Demo the way to capture exceptions from thread.