code: public static Deque<SentryException> extractExceptionQueue(Throwable throwable) {
          Deque<SentryException> exceptions = new ArrayDeque<>();
          Set<Throwable> circularityDetector = new HashSet<>();
          StackTraceElement[] childExceptionStackTrace = new StackTraceElement[0];
  
          //Stack the exceptions to send them in the reverse order
          while (throwable != null && circularityDetector.add(throwable)) {
              exceptions.add(new SentryException(throwable, childExceptionStackTrace));
              childExceptionStackTrace = throwable.getStackTrace();
              throwable = throwable.getCause();
          }
  
          return exceptions;
      }
docs: Transforms a {@link Throwable} into a Queue of {@link SentryException}.
  <p>
  Exceptions are stored in the queue from the most recent one to the oldest one.
  
  @param throwable throwable to transform in a queue of exceptions.
  @return a queue of exception with StackTrace.