public function getErrorMessage( bool $appendPreviousByNewline = false ) : string
   {

      // Getting a optional previous exception
      $prev = $this->getPrevious();

      if ( null === $prev )
      {

         // If no previous exception is used
         return \sprintf(
            '%s(%d): %s',
            static::GetCodeName( $this->getCode() ),
            $this->getCode(),
            $this->getMessage()
         );

      }

      // Define the separator between current and previous exception.
      $separator = $appendPreviousByNewline ? "\n" : ' ';

      if ( $prev instanceof NiirrtyException )
      {

         return \sprintf(
            '%s(%d): %s%s%s',
            static::GetCodeName( $this->getCode() ),
            $this->getCode(),
            $this->getMessage(),
            $separator,
            $prev->getErrorMessage( $appendPreviousByNewline )
         );

      }

      return \sprintf(
         '%s(%d): %s%s%s',
         static::GetCodeName( $this->getCode() ),
         $this->getCode(),
         $this->getMessage(),
         $separator,
         $prev->getMessage()
      );

   }
public function getErrorMessage( bool $appendPreviousByNewline = false ) : string
   {

      // Getting a optional previous exception
      $prev = $this->getPrevious();

      if ( null === $prev )
      {

         // If no previous exception is used
         return \sprintf(
            '%s(%d): %s',
            static::GetCodeName( $this->getCode() ),
            $this->getCode(),
            $this->getMessage()
         );

      }

      // Define the separator between current and previous exception.
      $separator = $appendPreviousByNewline ? "\n" : ' ';

      if ( $prev instanceof NiirrtyException )
      {

         return \sprintf(
            '%s(%d): %s%s%s',
            static::GetCodeName( $this->getCode() ),
            $this->getCode(),
            $this->getMessage(),
            $separator,
            $prev->getErrorMessage( $appendPreviousByNewline )
         );

      }

      return \sprintf(
         '%s(%d): %s%s%s',
         static::GetCodeName( $this->getCode() ),
         $this->getCode(),
         $this->getMessage(),
         $separator,
         $prev->getMessage()
      );

   }
public function getErrorMessage ( bool $ appendPreviousByNewline = false ) : string { // Getting a optional previous exception $ prev = $ this -> getPrevious ( ) ; if ( null === $ prev ) { // If no previous exception is used return \ sprintf ( '%s(%d): %s' , static :: GetCodeName ( $ this -> getCode ( ) ) , $ this -> getCode ( ) , $ this -> getMessage ( ) ) ; } // Define the separator between current and previous exception. $ separator = $ appendPreviousByNewline ? "\n" : ' ' ; if ( $ prev instanceof NiirrtyException ) { return \ sprintf ( '%s(%d): %s%s%s' , static :: GetCodeName ( $ this -> getCode ( ) ) , $ this -> getCode ( ) , $ this -> getMessage ( ) , $ separator , $ prev -> getErrorMessage ( $ appendPreviousByNewline ) ) ; } return \ sprintf ( '%s(%d): %s%s%s' , static :: GetCodeName ( $ this -> getCode ( ) ) , $ this -> getCode ( ) , $ this -> getMessage ( ) , $ separator , $ prev -> getMessage ( ) ) ; }
Extends the origin getMessage method, so also previous messages are included, if defined.

@param  bool $appendPreviousByNewline If a prev. Exception is defined append it by a new line? (' ' other)
@return string
Extends the origin getMessage method so also previous messages are included if defined .