Correct exception handling.

Update exception message parsing to a workable method.