PS:

We already have a utility that fixes exceptions: ExceptionUtils.fixRemoteStackTrace