src/Trace.php
public static function catchApp($error)
    {
        $e['type']    = 0;
        $e['message'] = $error->getMessage();
        $e['file']    = $error->getFile();
        $e['line']    = $error->getLine();
        $e['trace']   = '';

        $debugContent = self::getFileContent($e['file'], $e['line']);

        if ($error->getTrace()) {
            foreach ($error->getTrace() as $key => $value) {
                $e['trace'] .= ($key + 1) . ' File :' . (!empty($value['file']) ? $value['file'] : '未知地址');
                if (isset($value['class'])) {
                    $e['trace'] .= ' From Class :' . $value['class'];
                }

                if (isset($value['class'])) {
                    $e['trace'] .= ' In Function :' . $value['function'];
                }

                $e['trace'] .= ' on line ' . (!empty($value['line']) ? $value['line'] : '未知行数') . PHP_EOL;
            }
        }

        if (config('trace')) {
            return include FARM_PATH . DS . 'trace' . DS . 'error.html';
        } else {
            header("http/1.1 404 not found");
            header("status: 404 not found");
            return include FARM_PATH . DS . 'trace' . DS . '404.html';
        }
    }
public static function catchApp($error)
    {
        $e['type']    = 0;
        $e['message'] = $error->getMessage();
        $e['file']    = $error->getFile();
        $e['line']    = $error->getLine();
        $e['trace']   = '';

        $debugContent = self::getFileContent($e['file'], $e['line']);

        if ($error->getTrace()) {
            foreach ($error->getTrace() as $key => $value) {
                $e['trace'] .= ($key + 1) . ' File :' . (!empty($value['file']) ? $value['file'] : '未知地址');
                if (isset($value['class'])) {
                    $e['trace'] .= ' From Class :' . $value['class'];
                }

                if (isset($value['class'])) {
                    $e['trace'] .= ' In Function :' . $value['function'];
                }

                $e['trace'] .= ' on line ' . (!empty($value['line']) ? $value['line'] : '未知行数') . PHP_EOL;
            }
        }

        if (config('trace')) {
            return include FARM_PATH . DS . 'trace' . DS . 'error.html';
        } else {
            header("http/1.1 404 not found");
            header("status: 404 not found");
            return include FARM_PATH . DS . 'trace' . DS . '404.html';
        }
    }
捕获未处理的自定义错误信息 并显示