src/debug/DebugHelper.php
public static function composeBetterMessage(\Exception $exception, $indent = '') {
        if ($exception instanceof PHPError) {
            $result    = $exception->getSimpleType();
        }
        else {
            $class     = get_class($exception);
            $namespace = strtolower(strLeftTo($class, '\\', -1, true, ''));
            $basename  = simpleClassName($class);
            $result    = $indent.$namespace.$basename;

            if ($exception instanceof \ErrorException)                                  // A PHP error exception not created
                $result .= '('.self::errorLevelToStr($exception->getSeverity()).')';    // by the framework.
        }
        $message = $exception->getMessage();

        if (strlen($indent)) {
            $lines = explode(NL, normalizeEOL($message));                               // indent multiline messages
            $eom = '';
            if (strEndsWith($message, NL)) {
                \array_pop($lines);
                $eom = NL;
            }
            $message = join(NL.$indent, $lines).$eom;
        }

        $result .= (strlen($message) ? ': ':'').$message;
        return $result;
    }
public static function composeBetterMessage(\Exception $exception, $indent = '') {
        if ($exception instanceof PHPError) {
            $result    = $exception->getSimpleType();
        }
        else {
            $class     = get_class($exception);
            $namespace = strtolower(strLeftTo($class, '\\', -1, true, ''));
            $basename  = simpleClassName($class);
            $result    = $indent.$namespace.$basename;

            if ($exception instanceof \ErrorException)                                  // A PHP error exception not created
                $result .= '('.self::errorLevelToStr($exception->getSeverity()).')';    // by the framework.
        }
        $message = $exception->getMessage();

        if (strlen($indent)) {
            $lines = explode(NL, normalizeEOL($message));                               // indent multiline messages
            $eom = '';
            if (strEndsWith($message, NL)) {
                \array_pop($lines);
                $eom = NL;
            }
            $message = join(NL.$indent, $lines).$eom;
        }

        $result .= (strlen($message) ? ': ':'').$message;
        return $result;
    }
public static function composeBetterMessage ( \ Exception $ exception , $ indent = '' ) { if ( $ exception instanceof PHPError ) { $ result = $ exception -> getSimpleType ( ) ; } else { $ class = get_class ( $ exception ) ; $ namespace = strtolower ( strLeftTo ( $ class , '\\' , - 1 , true , '' ) ) ; $ basename = simpleClassName ( $ class ) ; $ result = $ indent . $ namespace . $ basename ; if ( $ exception instanceof \ ErrorException ) // A PHP error exception not created $ result .= '(' . self :: errorLevelToStr ( $ exception -> getSeverity ( ) ) . ')' ; // by the framework. } $ message = $ exception -> getMessage ( ) ; if ( strlen ( $ indent ) ) { $ lines = explode ( NL , normalizeEOL ( $ message ) ) ; // indent multiline messages $ eom = '' ; if ( strEndsWith ( $ message , NL ) ) { \ array_pop ( $ lines ) ; $ eom = NL ; } $ message = join ( NL . $ indent , $ lines ) . $ eom ; } $ result .= ( strlen ( $ message ) ? ': ' : '' ) . $ message ; return $ result ; }
Return a more readable version of an exception's message.

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

@return string - message
Return a more readable version of an exception s message .