code: Throwable externalCause()
      {
          IdentityHashMap<Throwable, Throwable> seen =
              new IdentityHashMap<Throwable, Throwable>();
  
          Throwable cause = getCause();
          while (cause instanceof IonException)
          {
              if (seen.put(cause, cause) != null)  // cycle check
              {
                  return null;
              }
              cause = cause.getCause();
          }
          return cause;
      }
docs: Finds the first exception in the {@link #getCause()} chain that's not
  an {@link IonException}.
  
  @return null if there's no cause that's not an {@link IonException}.