public static function reduceStackTrace(\Throwable $exception, $trace)
    {
        $exclude = [
            'Reaction\Promise\Promise' => ['settle'],
            'React\Promise\Promise' => ['settle'],
            'Rx\Observer\AbstractObserver' => [],
            'Rx\Observer\AutoDetachObserver' => [],
            'Rx\Observer\CallbackObserver' => [],
        ];
        $file = $exception->getFile();
        $traceNew = [];
        foreach ($trace as $num => $row) {
            $rowFile = isset($row['file']) ? $row['file'] : null;
            $rowClass = isset($row['class']) ? $row['class'] : null;
            $rowFunction = isset($row['function']) ? $row['function'] : '{closure}';
            if (
                isset($exclude[$rowClass])
                && (empty($exclude[$rowClass]) || in_array($rowFunction, $exclude[$rowClass]))
                && $rowFile !== $file
            ) {
                continue;
            }
            $traceNew[] = $row;
        }
        return $traceNew;
    }