protected function initTrace(int $index, string $trace): void
    {
        $lines = explode(':', $trace, 2);
        $headerKey = sprintf('h%s', $index);
        $callKey = sprintf('c%s', $index);

        $this->templates[] = sprintf('<exception_trace:%s>', $headerKey);
        $this->templates[] = sprintf("<exception_body:%s>\n", $callKey);

        $this->replacements[$headerKey] = $lines[0];
        $this->replacements[$callKey] = $lines[1] ?? '';
    }