code: private static void check(Thread thread, AtomicReference<Throwable> reference)
      {
          try
          {
              thread.join();
          }
          catch (final InterruptedException exception)
          {
              Thread.currentThread().interrupt();
              throw new LionEngineException(exception, ERROR_TASK_STOPPED);
          }
          final Throwable throwable = reference.get();
          if (throwable != null)
          {
              Engine.terminate();
              if (throwable instanceof LionEngineException)
              {
                  throw (LionEngineException) throwable;
              }
              throw new LionEngineException(throwable);
          }
      }
docs: Check thread execution by waiting its end, and re-throw exception if has.
  
  @param thread The thread reference.
  @param reference The thread exception referencer.