How to Identify the type of exception thrown??

Is there any way to get the exceptionType when we enter in to catch block.
We are trying to implement a wrapper around some of our retry mechanisms for our transient errors and in that process, I need to identify in the topmost service if any of the child services have thrown a pub.flow:throwExceptionForRetry.

Any ideas??

At this point I have noticed that lastError/callStack[0] will have the original exception and I can go against it. But i wanted to check if there is any better way to determine the root exception. WMUsers mentioned a service ps.util.system:getExceptionType , which I didnt find in out PSUtilities package.

Thanks In Advance