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;
    }