code: public function getLongMessage($glue = ' ')
      {
          $messages  = array();
          $exception = $this;
          do {
              $messages[] = $exception->getMessage();
          } while (null !== ($exception = $exception->getPrevious()));
  
          return implode($glue, $messages);
      }
docs: Retrieve the messages of all exceptions as chain.
  
  @param string $glue The glue to use to combine all exception messages.
  
  @return string