src/debug/DebugHelper.php
public static function getBetterTraceAsString(\Exception $exception, $indent = '') {
        if ($exception instanceof IRosasurferException) $trace = $exception->getBetterTrace();
        else                                            $trace = self::fixTrace($exception->getTrace(), $exception->getFile(), $exception->getLine());
        $result = self::formatTrace($trace, $indent);

        if ($cause=$exception->getPrevious()) {
            // recursively add stacktraces of nested exceptions
            $message = trim(self::composeBetterMessage($cause, $indent));
            $result .= NL.$indent.'caused by'.NL.$indent.$message.NL.NL;
            $result .= self::{__FUNCTION__}($cause, $indent);                 // recursion
        }
        return $result;
    }
public static function getBetterTraceAsString(\Exception $exception, $indent = '') {
        if ($exception instanceof IRosasurferException) $trace = $exception->getBetterTrace();
        else                                            $trace = self::fixTrace($exception->getTrace(), $exception->getFile(), $exception->getLine());
        $result = self::formatTrace($trace, $indent);

        if ($cause=$exception->getPrevious()) {
            // recursively add stacktraces of nested exceptions
            $message = trim(self::composeBetterMessage($cause, $indent));
            $result .= NL.$indent.'caused by'.NL.$indent.$message.NL.NL;
            $result .= self::{__FUNCTION__}($cause, $indent);                 // recursion
        }
        return $result;
    }
public static function getBetterTraceAsString ( \ Exception $ exception , $ indent = '' ) { if ( $ exception instanceof IRosasurferException ) $ trace = $ exception -> getBetterTrace ( ) ; else $ trace = self :: fixTrace ( $ exception -> getTrace ( ) , $ exception -> getFile ( ) , $ exception -> getLine ( ) ) ; $ result = self :: formatTrace ( $ trace , $ indent ) ; if ( $ cause = $ exception -> getPrevious ( ) ) { // recursively add stacktraces of nested exceptions $ message = trim ( self :: composeBetterMessage ( $ cause , $ indent ) ) ; $ result .= NL . $ indent . 'caused by' . NL . $ indent . $ message . NL . NL ; $ result .= self :: { __FUNCTION__ } ( $ cause , $ indent ) ; // recursion } return $ result ; }
Return a more readable version of an exception's stacktrace. The representation also contains information about
nested exceptions.

@param  \Exception $exception         - any exception (not only RosasurferExceptions)
@param  string     $indent [optional] - indent the resulting lines by this value (default: empty string)

@return string - readable stacktrace
Return a more readable version of an exception s stacktrace . The representation also contains information about nested exceptions .